aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/snippet.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/snippet.lua')
-rw-r--r--runtime/lua/vim/snippet.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/lua/vim/snippet.lua b/runtime/lua/vim/snippet.lua
index 14f73bff5c..94c69795a4 100644
--- a/runtime/lua/vim/snippet.lua
+++ b/runtime/lua/vim/snippet.lua
@@ -278,6 +278,11 @@ local function setup_autocmds(bufnr)
desc = 'Update snippet state when the cursor moves',
buffer = bufnr,
callback = function()
+ -- Just update the tabstop in insert and select modes.
+ if not vim.fn.mode():match('^[isS]') then
+ return
+ end
+
local cursor_row, cursor_col = cursor_pos()
-- The cursor left the snippet region.
@@ -292,11 +297,6 @@ local function setup_autocmds(bufnr)
return true
end
- -- Just update the tabstop in insert and select modes.
- if not vim.fn.mode():match('^[isS]') then
- return
- end
-
-- Update the current tabstop to be the one containing the cursor.
for tabstop_index, tabstops in pairs(M._session.tabstops) do
for _, tabstop in ipairs(tabstops) do