You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug, but whenever I perform a visual select and then expand a snippet, I get my visual select right where I want it in my snippet (i.e. which is how it should work), but then if I expand another visual snippet, I get the same piece of text inside this snippet. I don't want this to happen.
Is there a way to make it so that a visual selection is used only once in an expansion, and then not used afterwards? Here are some of the snippets where I see this happen:
global !p
def wraps(char):
a = vim.current.window.buffer
b = vim.current.window.cursor[0]
c = vim.current.window.cursor[1]
try:
return a[b-1][c-1] + a[b-1][c] != char
except:
return True
endglobal
context "wraps('()')"
snippet ( "parenthesis" iA
(${1:${VISUAL}})$0
endsnippet
snippet { "Braces" iA
{
${1:${VISUAL}}
}
endsnippet
context "wraps('[]')"
snippet [ "Brackets" iA
[${1:${VISUAL}}]$0
endsnippet
Thank you for your help and time.
The text was updated successfully, but these errors were encountered:
I do have the same problem. If I use visual place holder to put some code in an expanded snippet. Then after that, the visual place holder would be replaced every time when I expand a snippet if I do not select anything when I expand it.
I'm not sure if this is a bug, but whenever I perform a visual select and then expand a snippet, I get my visual select right where I want it in my snippet (i.e. which is how it should work), but then if I expand another visual snippet, I get the same piece of text inside this snippet. I don't want this to happen.
Is there a way to make it so that a visual selection is used only once in an expansion, and then not used afterwards? Here are some of the snippets where I see this happen:
Thank you for your help and time.
The text was updated successfully, but these errors were encountered: