mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix popup alignment with signcolumn
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user