diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-08-27 20:50:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 05:50:37 -0700 |
commit | 32024787b6b1ef39c23bda1653c23b5dfbde9e81 (patch) | |
tree | ca42840d15eac7d352d7f8c101da1b866168b554 /src/nvim/screen.c | |
parent | 08e223cebb8916f01270b5a332e6202df58609a9 (diff) | |
download | rneovim-32024787b6b1ef39c23bda1653c23b5dfbde9e81.tar.gz rneovim-32024787b6b1ef39c23bda1653c23b5dfbde9e81.tar.bz2 rneovim-32024787b6b1ef39c23bda1653c23b5dfbde9e81.zip |
vim-patch:8.1.2229: color number column above/below cursor #15409
Problem: Cannot color number column above/below cursor differently.
Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624)
https://github.com/vim/vim/commit/efae76ab1a43d5a628d8c2fa4218ace6ba597f5d
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 208ae3488f..580f591b11 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2812,6 +2812,15 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, n_extra = number_width(wp) + 1; char_attr = win_hl_attr(wp, HLF_N); + if (wp->w_p_rnu && lnum < wp->w_cursor.lnum) { + // Use LineNrAbove + char_attr = win_hl_attr(wp, HLF_LNA); + } + if (wp->w_p_rnu && lnum > wp->w_cursor.lnum) { + // Use LineNrBelow + char_attr = win_hl_attr(wp, HLF_LNB); + } + sign_attrs_T *num_sattr = sign_get_attr(SIGN_NUMHL, sattrs, 0, 1); if (num_sattr != NULL) { // :sign defined with "numhl" highlight. |