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):
127127 if not snip.c:
128128 # Do this only once, otherwise the following error would happen:
129129 # 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 ]
132136
133137 # Handle already existing quote chars after the trigger.
134138 _ret = quoting_style * 3
135139 while True :
136140 try :
137- nextc = line[col]
141+ nextc = line[col - 1 ]
138142 except IndexError :
139143 break
140144 if nextc == quoting_style and len (_ret):
You can’t perform that action at this time.
0 commit comments