Skip to content

Commit

Permalink
Consider cmp in pumvisible
Browse files Browse the repository at this point in the history
  • Loading branch information
andymass committed Nov 25, 2023
1 parent 269f9be commit 7c4e8a0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion autoload/matchup/matchparen.vim
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function! s:matchparen.highlight(...) abort dict " {{{1

if has('vim_starting') | return | endif

if !g:matchup_matchparen_pumvisible && pumvisible() | return | endif
if !g:matchup_matchparen_pumvisible && s:pumvisible() | return | endif

" try to avoid interfering with some auto-complete plugins
if has('*state') && state('a') !=# '' | return | endif
Expand Down Expand Up @@ -502,6 +502,18 @@ function s:matchparen.transmute_reset() abort dict
endif
endfunction


if has('nvim')
function s:pumvisible() abort
return pumvisible() || luaeval('pcall(require, "cmp")')
\ && luaeval('require"cmp".visible()')
endfunction
else
function s:pumvisible() abort
return pumvisible()
endfunction
endif

" }}}1

function! s:do_popup_autocmd_enter(win_context) abort "{{{1
Expand Down

0 comments on commit 7c4e8a0

Please sign in to comment.