File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -127,14 +127,18 @@ def triple_quotes_handle_trailing(snip, quoting_style):
127
127
if not snip.c:
128
128
# Do this only once, otherwise the following error would happen:
129
129
# RuntimeError: The snippets content did not converge: …
130
- _, col = vim.current.window.cursor
131
- line = vim.current.line
130
+ row, col = vim.current.window.cursor
131
+
132
+ # before ultisnip expansion, chars ahead cursor is at row - 1, col
133
+ # after ultisnip expansion, they are pushed to row + 1, col - 1
134
+ # when this function is run, it's already after ultisni expansion
135
+ line = snip.buffer[row + 1 ]
132
136
133
137
# Handle already existing quote chars after the trigger.
134
138
_ret = quoting_style * 3
135
139
while True :
136
140
try :
137
- nextc = line[col]
141
+ nextc = line[col - 1 ]
138
142
except IndexError :
139
143
break
140
144
if nextc == quoting_style and len (_ret):
You can’t perform that action at this time.
0 commit comments