Mercurial > vim
diff src/screen.c @ 18047:6650e3dff8d4 v8.1.2019
patch 8.1.2019: 'cursorline' always highlights the whole line
Commit: https://github.com/vim/vim/commit/410e98a70bc00ea4bed51e55a8fe20e56a72c087
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 9 22:05:49 2019 +0200
patch 8.1.2019: 'cursorline' always highlights the whole line
Problem: 'cursorline' always highlights the whole line.
Solution: Add 'cursorlineopt' to specify what is highlighted.
(closes #4693)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 Sep 2019 22:15:04 +0200 |
parents | 079e10a49ea1 |
children | 1101eacc1444 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -3817,7 +3817,7 @@ win_line( { // Do not show the cursor line when Visual mode is active, because it's // not clear what is selected then. Do update w_last_cursorline. - if (!(wp == curwin && VIsual_active)) + if (!(wp == curwin && VIsual_active) && *wp->w_p_culopt != 'n') { line_attr = HL_ATTR(HLF_CUL); area_highlighting = TRUE; @@ -4021,6 +4021,7 @@ win_line( * TODO: Can we use CursorLine instead of CursorLineNr * when CursorLineNr isn't set? */ if ((wp->w_p_cul || wp->w_p_rnu) + && *wp->w_p_culopt != 'l' && lnum == wp->w_cursor.lnum) char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLN)); #endif @@ -4055,7 +4056,8 @@ win_line( { char_attr = HL_ATTR(diff_hlf); # ifdef FEAT_SYN_HL - if (wp->w_p_cul && lnum == wp->w_cursor.lnum) + if (wp->w_p_cul && lnum == wp->w_cursor.lnum + && *wp->w_p_culopt != 'n') char_attr = hl_combine_attr(char_attr, HL_ATTR(HLF_CUL)); # endif @@ -4117,7 +4119,8 @@ win_line( tocol += n_extra; #ifdef FEAT_SYN_HL /* combine 'showbreak' with 'cursorline' */ - if (wp->w_p_cul && lnum == wp->w_cursor.lnum) + if (wp->w_p_cul && lnum == wp->w_cursor.lnum + && *wp->w_p_culopt != 'n') char_attr = hl_combine_attr(char_attr, HL_ATTR(HLF_CUL)); #endif @@ -4212,7 +4215,8 @@ win_line( && n_extra == 0) diff_hlf = HLF_CHD; /* changed line */ line_attr = HL_ATTR(diff_hlf); - if (wp->w_p_cul && lnum == wp->w_cursor.lnum) + if (wp->w_p_cul && lnum == wp->w_cursor.lnum + && *wp->w_p_culopt != 'n') line_attr = hl_combine_attr(line_attr, HL_ATTR(HLF_CUL)); } #endif @@ -5180,7 +5184,8 @@ win_line( if (vi_attr == 0 || char_attr != vi_attr) { char_attr = HL_ATTR(diff_hlf); - if (wp->w_p_cul && lnum == wp->w_cursor.lnum) + if (wp->w_p_cul && lnum == wp->w_cursor.lnum + && *wp->w_p_culopt != 'n') char_attr = hl_combine_attr(char_attr, HL_ATTR(HLF_CUL)); }