mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(snippet): early return for final tabstop #35115
The cursor movement autocommand can not detect when the final tabstop $0 is directly adjacent to another tabstop, which prevents ending the snippet session. The fix is an early return when jumping.
This commit is contained in:
@@ -585,6 +585,12 @@ function M.jump(direction)
|
||||
M._session.current_tabstop = dest
|
||||
select_tabstop(dest)
|
||||
|
||||
-- The cursor is not on a tabstop so exit the session.
|
||||
if dest.index == 0 then
|
||||
M.stop()
|
||||
return
|
||||
end
|
||||
|
||||
-- Activate expansion of the destination tabstop.
|
||||
M._session:set_group_gravity(dest.index, false)
|
||||
|
||||
|
Reference in New Issue
Block a user