Skip to content

Commit

Permalink
Merge pull request #94 from cocopon/fix-indent-with-tab
Browse files Browse the repository at this point in the history
Fix tab indent for popup
  • Loading branch information
andymass authored May 8, 2020
2 parents bae99f0 + f52937b commit 6836995
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autoload/matchup/matchparen.vim
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,14 @@ function! s:do_offscreen_popup(offscreen) " {{{1
if &number || &relativenumber
let l:text = printf('%*S ', wincol()-virtcol('.')-1, l:lnum)
endif
let l:text .= getline(l:lnum) . ' '

" replace tab indent with spaces
" (popup window doesn't follow tabstop option of current buffer)
let l:linestr = getline(l:lnum)
let l:indent = repeat(' ', strdisplaywidth(matchstr(l:linestr, '^\s\+')))
let l:linestr = substitute(l:linestr, '^\s\+', l:indent, '')

let l:text .= l:linestr . ' '
if l:adjust
let l:text .= '' . a:offscreen.match . ' '
endif
Expand Down

0 comments on commit 6836995

Please sign in to comment.