fix(lsp): do not cancel snippet when selecting placeholder (#25835)

This commit is contained in:
Maria José Solano
2023-10-30 04:58:28 -07:00
committed by GitHub
parent 8405649f92
commit 0fe0cf5ada
2 changed files with 7 additions and 7 deletions

View File

@@ -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