Skip to content

Commit 6836995

Browse files
authored
Merge pull request #94 from cocopon/fix-indent-with-tab
Fix tab indent for popup
2 parents bae99f0 + f52937b commit 6836995

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

autoload/matchup/matchparen.vim

+8-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,14 @@ function! s:do_offscreen_popup(offscreen) " {{{1
597597
if &number || &relativenumber
598598
let l:text = printf('%*S ', wincol()-virtcol('.')-1, l:lnum)
599599
endif
600-
let l:text .= getline(l:lnum) . ' '
600+
601+
" replace tab indent with spaces
602+
" (popup window doesn't follow tabstop option of current buffer)
603+
let l:linestr = getline(l:lnum)
604+
let l:indent = repeat(' ', strdisplaywidth(matchstr(l:linestr, '^\s\+')))
605+
let l:linestr = substitute(l:linestr, '^\s\+', l:indent, '')
606+
607+
let l:text .= l:linestr . ' '
601608
if l:adjust
602609
let l:text .= '' . a:offscreen.match . ' '
603610
endif

0 commit comments

Comments
 (0)