Fix popup alignment with signcolumn

This commit is contained in:
Andy K. Massimino
2021-10-04 09:30:44 -04:00
parent 870df0bb74
commit deec2858c9

View File

@@ -674,7 +674,7 @@ endfunction
function! s:set_popup_text_2(lnum, adjust, offscreen) abort
let [l:sl, l:lnum] = matchup#matchparen#status_str(
\ a:offscreen, {'noshowdir': 1})
let l:sl = substitute(l:sl, '%<', '', 'g')
let l:sl = '%#Normal#' . substitute(l:sl, '%<', '', 'g')
let l:props = []
let l:col = 1
@@ -682,6 +682,13 @@ 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, '#')
let l:rest = join(l:rest, '')
let l:len = len(l:rest)
if !l:len
continue
endif
if l:hl =~# '^\s*$'
continue
endif
@@ -697,13 +704,12 @@ function! s:set_popup_text_2(lnum, adjust, offscreen) abort
let s:prop_cache[l:key] = 1
endif
let l:rest = join(l:rest, '')
let l:len = len(l:rest)
call add(l:props, {
\ 'length': l:len,
\ 'col': l:col,
\ 'type': l:key
\})
let l:text .= l:rest
let l:col += l:len
endfor