mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix offscreen popup, add option syntax_hl, fixes #182
This commit is contained in:
@@ -611,14 +611,17 @@ function! s:do_offscreen_popup(offscreen) " {{{1
|
||||
\ 'maxheight': 1,
|
||||
\})
|
||||
|
||||
call matchup#perf#tic('matchparen.render_popup')
|
||||
if exists('*prop_type_add') && exists('*popup_settext')
|
||||
\ && get(g:matchup_matchparen_offscreen, 'syntax_hl', 0)
|
||||
" requires patch 8.1.1553
|
||||
let l:width = s:set_popup_text_2(l:lnum, l:adjust, a:offscreen)
|
||||
else
|
||||
let l:width = s:set_popup_text(l:lnum, l:adjust, a:offscreen)
|
||||
endif
|
||||
call matchup#perf#toc('matchparen.render_popup', 'done')
|
||||
|
||||
let l:rpad = 1
|
||||
let l:rpad = 0
|
||||
if get(g:matchup_matchparen_offscreen, 'fullwidth', 0)
|
||||
\ && exists('*popup_setoptions')
|
||||
let l:rpad = winwidth(0) - l:width
|
||||
@@ -679,6 +682,11 @@ function! s:set_popup_text_2(lnum, adjust, offscreen) abort
|
||||
for l:item in split(l:sl, '%\@1<!%#')
|
||||
let [l:hl; l:rest] = split(l:item, '#')
|
||||
|
||||
if l:hl =~# '^\s*$'
|
||||
echo l:hl
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:key = 'matchup__' . l:hl
|
||||
if !has_key(s:prop_cache, l:key)
|
||||
if empty(prop_type_get(l:key, {'bufnr': winbufnr(t:match_popup)}))
|
||||
|
||||
Reference in New Issue
Block a user