Skip to content

Commit

Permalink
fix issue #1087
Browse files Browse the repository at this point in the history
  • Loading branch information
Yggdroot committed Jul 4, 2024
1 parent 47380c4 commit 967393d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions autoload/leaderf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ endfunction

function! leaderf#Quit(manager_id) abort
exec g:Lf_py "import ctypes"
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value.is_autocmd = True", a:manager_id)
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value.quit()", a:manager_id)
exec g:Lf_py printf("ctypes.cast(%d, ctypes.py_object).value.is_autocmd = False", a:manager_id)
endfunction

function! leaderf#ResetPopupOptions(winid, option, value) abort
Expand Down
3 changes: 2 additions & 1 deletion autoload/leaderf/python/leaderf/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,8 @@ def exitBuffer(self):
vim.options['eventignore'] = saved_eventignore

if len(vim.windows) > 1:
lfCmd("silent! hide")
if self._manager.is_autocmd == False:
lfCmd("silent! hide")
if self._orig_win_id is not None:
lfCmd("call win_gotoid(%d)" % self._orig_win_id)
else:
Expand Down
1 change: 1 addition & 0 deletions autoload/leaderf/python/leaderf/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def __init__(self):
self._preview_filetype = None
self._orig_source = None
self._preview_config = {}
self.is_autocmd = False
self._circular_scroll = lfEval("get(g:, 'Lf_EnableCircularScroll', 0)") == '1'
if lfEval("has('patch-8.1.1615') || has('nvim-0.5.0')") == '0':
lfCmd("let g:Lf_PreviewInPopup = 0")
Expand Down

0 comments on commit 967393d

Please sign in to comment.