Skip to content

Commit 92b07a2

Browse files
committed
fix(ivy): do not set cursor on hide abort
1 parent 76e7f90 commit 92b07a2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lua/fzf-lua/profiles/ivy.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ local focused_win = {
132132
end,
133133
on_close = function()
134134
vim.api.nvim_buf_clear_namespace(buf, ns, 0, -1)
135-
vim.api.nvim_win_set_cursor(0, FzfLua.utils.__CTX().cursor)
136-
FzfLua.utils.zz()
135+
-- on hide + change picker ctx will be nil
136+
local ctx = FzfLua.utils.__CTX()
137+
if ctx then
138+
vim.api.nvim_win_set_cursor(0, ctx.cursor)
139+
FzfLua.utils.zz()
140+
end
137141
end,
138142
}
139143
end,

0 commit comments

Comments
 (0)