summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-09 22:05:49 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-09 22:05:49 +0200
commit410e98a70bc00ea4bed51e55a8fe20e56a72c087 (patch)
treee0104f5f3a0f6974c686b3905e551fdcfc6a9f7f /src/screen.c
parente5fbd7393067c279860598ac8359d1617b1082b9 (diff)
downloadvim-git-410e98a70bc00ea4bed51e55a8fe20e56a72c087.tar.gz
patch 8.1.2019: 'cursorline' always highlights the whole linev8.1.2019
Problem: 'cursorline' always highlights the whole line. Solution: Add 'cursorlineopt' to specify what is highlighted. (closes #4693)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/screen.c b/src/screen.c
index d9f96fc7a..eb71d7678 100644
--- 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));
}