We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replacement string item contains newlines
I have a configuration that can easily add custom surround before and after a motion/text object.
However, when I change the join character from a space to a \n, it throws an error in the case of multiple lines.
\n
local function surround_cword(keymap, left, right) local function surround(lines) local str = vim.iter(lines):join(" ") return { left .. str .. right } end op_map("v", keymap, surround) vim.keymap.set("n", keymap, function() return require("yop").operate(surround) .. "iw" end, { expr = true, remap = true }) end surround_cword("8d", "--", "") surround_cword("8v", "var(--", ")") surround_cword("8c", "calc(", ")") surround_cword("8x", "${", "}") surround_cword("8s", "{ condition ? ", " : null }")
local str = vim.iter(lines):join("\n") -- error on multiple lines
Record:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a configuration that can easily add custom surround before and after a motion/text object.
However, when I change the join character from a space to a
\n
, it throws an error in the case of multiple lines.Record:
![ezgif-7-692021a06d](https://private-user-images.githubusercontent.com/4456413/347373672-1b21b714-2117-46dd-8e15-7903f39755ca.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNjM0MDEsIm5iZiI6MTczOTA2MzEwMSwicGF0aCI6Ii80NDU2NDEzLzM0NzM3MzY3Mi0xYjIxYjcxNC0yMTE3LTQ2ZGQtOGUxNS03OTAzZjM5NzU1Y2EuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMDEwNTAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGUxMGNiMTczODQ2OGU4ZTQ3N2ViYTVlNmVmZDAxZTZhNzRkNGUwNDhkODlkZGI0M2VhZGU0MmQyODIyNTRiZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.xRxO00Mr-Z5mAMbiAlPYtcX37K6ThGDdNRuxYImZJyU)
The text was updated successfully, but these errors were encountered: