diff --git a/autoload/vital/_compe/VS/Vim/Window/FloatingWindow.vim b/autoload/vital/_compe/VS/Vim/Window/FloatingWindow.vim index af4e940..6e5da51 100644 --- a/autoload/vital/_compe/VS/Vim/Window/FloatingWindow.vim +++ b/autoload/vital/_compe/VS/Vim/Window/FloatingWindow.vim @@ -213,6 +213,10 @@ function! s:FloatingWindow.open(args) abort \ 'origin': get(a:args, 'origin', 'topleft'), \ } + if has('nvim') + let l:style.relative = get(a:args, 'relative', 'editor') + endif + let l:will_move = self.is_visible() if l:will_move let self._winid = s:_move(self, self._winid, self._bufnr, l:style) @@ -376,7 +380,7 @@ if has('nvim') let l:style = s:_resolve_origin(a:style) let l:style = s:_resolve_border(l:style) let l:style = { - \ 'relative': 'editor', + \ 'relative': has_key(l:style, 'relative') ? l:style.relative : 'editor', \ 'row': l:style.row - 1, \ 'col': l:style.col - 1, \ 'width': l:style.width, diff --git a/lua/compe/float.lua b/lua/compe/float.lua index 748264b..10ecfee 100644 --- a/lua/compe/float.lua +++ b/lua/compe/float.lua @@ -50,7 +50,7 @@ function M.get_options(contents, opts) local col = right and right_col - 1 or (pum.col - width - 3) return { - relative = "editor", + relative = "win", style = "minimal", width = width, height = height,