From ef97672cf66cd3415781125616c4eb98e5ec06fa Mon Sep 17 00:00:00 2001 From: Enrico Maria De Angelis Date: Tue, 12 Jan 2021 17:50:19 +0000 Subject: [PATCH] Honor `relativenumber` in popup --- autoload/matchup/matchparen.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/matchup/matchparen.vim b/autoload/matchup/matchparen.vim index 8791aa9..a66676d 100644 --- a/autoload/matchup/matchparen.vim +++ b/autoload/matchup/matchparen.vim @@ -596,7 +596,12 @@ function! s:do_offscreen_popup(offscreen) " {{{1 " set popup text let l:text = '' if &number || &relativenumber - let l:text = printf('%*S ', wincol()-virtcol('.')-1, l:lnum) + if &relativenumber + let l:displaynumber = abs(l:lnum - line('.')) + else + let l:displaynumber = l:lnum + endif + let l:text = printf('%*S ', wincol()-virtcol('.')-1, l:displaynumber) endif " replace tab indent with spaces