Skip to content

Commit

Permalink
fix(lsp): clear context on jump_to_single_result (closes #928)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Nov 13, 2023
1 parent d32c7d2 commit 03d8c35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/fzf-lua/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,14 @@ function M.get_visual_selection()
end

function M.fzf_exit()
vim.cmd([[lua require('fzf-lua.win').win_leave()]])
-- Usually called from the LSP module to exit the interface on "async" mode
-- when no results are found or when `jump_to_single_result` is used, when
-- the latter is used in "sync" mode we also need to make sure core.__CTX
-- is cleared or we'll have the wrong cursor coordiantes (#928)
return loadstring([[
require('fzf-lua').core.__CTX = nil
require('fzf-lua').win.win_leave()
]])()
end

function M.fzf_winobj()
Expand Down

0 comments on commit 03d8c35

Please sign in to comment.