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)
efae76ab1a
This commit is contained in:
zeertzjq
2021-08-27 20:50:37 +08:00
committed by GitHub
parent 08e223cebb
commit 32024787b6
8 changed files with 135 additions and 15 deletions

View File

@@ -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.