Failed to find a proper window to locate when popup is shown
bstaint opened this issue ยท 12 comments
bstaint commented
lambdalisue commented
bstaint commented
lambdalisue commented
I thougt this is because nobuflisted
is not configured on the buffer but it was configured. https://github.com/lambdalisue/fern.vim/blob/master/autoload/fern/internal/drawer/hover_popup.vim#L76-L76
lambdalisue commented
This will be fixed by lambdalisue/vital-Whisky#43
lambdalisue commented
bstaint commented
help:
`relative` is empty for normal windows.
nvim_win_get_config(wi.winid).relative ==# ''
will fixed.
lambdalisue commented
Aha, fixed.
bstaint commented
bstaint commented
patch:
diff --git a/autoload/fern/internal/drawer/auto_restore_focus.vim b/autoload/fern/internal/drawer/auto_restore_focus.vim
index fcee18e..869e4a9 100644
--- a/autoload/fern/internal/drawer/auto_restore_focus.vim
+++ b/autoload/fern/internal/drawer/auto_restore_focus.vim
@@ -16,6 +16,7 @@ function! s:auto_restore_focus_pre() abort
\ 'nwin': winnr('$'),
\ 'tabpage': tabpagenr(),
\ 'prev': win_getid(winnr('#')),
+ \ 'relative': nvim_win_get_config(win_getid(winnr('$'))).relative
\}
call timer_start(0, { -> extend(s:, {'info': v:null}) })
endfunction
@@ -24,7 +25,7 @@ function! s:auto_restore_focus() abort
if s:info is# v:null
return
endif
- if s:info.tabpage is# tabpagenr() && s:info.nwin > winnr('$')
+ if s:info.tabpage is# tabpagenr() && s:info.nwin > winnr('$') && s:info.relative ==# ''
call win_gotoid(s:info.prev)
endif
let s:info = v:null
lambdalisue commented
I'm sorry for late. Well, the patch doesn't make sense so I cannot approve that.
lambdalisue commented
bstaint commented
Tks.