Problem: Cursorline highlighting always overrules sign highlighting.
Solution: Combine the highlighting, use the priority to decide how.
(closes #6812)
-*sign.txt* For Vim version 8.2. Last change: 2019 Nov 30
+*sign.txt* For Vim version 8.2. Last change: 2020 Aug 31
VIM REFERENCE MANUAL by Gordon Prieur
next line (or the last line of the buffer, if there is no next line). When
the delete is undone the sign does not move back.
+When a sign with line highlighting and 'cursorline' highlighting are both
+present, if the priority is 100 or more then the sign highlighting takes
+precedence, otherwise the 'cursorline' highlighting.
+
==============================================================================
2. Commands *sign-commands* *:sig* *:sign*
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
-" Last Change: 2020 Jul 12
+" Last Change: 2020 Aug 31
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with
endif
exe lnum
exe 'sign unplace ' . s:pc_id
- exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
+ exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC priority=110 file=' . fname
setlocal signcolumn=yes
endif
elseif !s:stopped || fname != ''
if (!cul_screenline)
{
cul_attr = HL_ATTR(HLF_CUL);
- line_attr = cul_attr;
+# ifdef FEAT_SIGNS
+ // Combine the 'cursorline' and sign highlighting, depending on
+ // the sign priority.
+ if (sign_present && sattr.sat_linehl > 0)
+ {
+ if (sattr.sat_priority >= 100)
+ line_attr = hl_combine_attr(cul_attr, line_attr);
+ else
+ line_attr = hl_combine_attr(line_attr, cul_attr);
+ }
+ else
+# endif
+ line_attr = cul_attr;
wp->w_last_cursorline = wp->w_cursor.lnum;
}
else
char_u *sat_text;
int sat_texthl;
int sat_linehl;
+ int sat_priority;
} sign_attrs_T;
#if defined(FEAT_SIGNS) || defined(PROTO)
--- /dev/null
+| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
+| +0#0000e05#a8a8a8255@1>m+8#0000001#40ff4011@3| @68
+| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
+|~+0#4040ff13&| @73
+|:+0#0000000&| @55|2|,|1| @10|A|l@1|
--- /dev/null
+| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
+| +0#0000e05#a8a8a8255@1>m+8#0000001#ffd7ff255@3| @68
+| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
+|~+0#4040ff13&| @73
+|:+0#0000000&| @55|2|,|1| @10|A|l@1|
call term_sendkeys(buf, ":sign unplace 10\<CR>")
call VerifyScreenDump(buf, 'Test_sign_cursor_4', {})
+ " 'cursorline' highlighting overrules sign
+ call term_sendkeys(buf, ":sign place 12 line=2 name=s2\<CR>")
+ call term_sendkeys(buf, ":set cursorline\<CR>")
+ call term_sendkeys(buf, ":hi CursorLine ctermbg=Green\<CR>")
+ call term_sendkeys(buf, "2G")
+ call term_sendkeys(buf, ":\<CR>")
+ call VerifyScreenDump(buf, 'Test_sign_cursor_5', {})
+
+ " sign highlighting overrules 'cursorline'
+ call term_sendkeys(buf, ":sign unplace 12\<CR>")
+ call term_sendkeys(buf, ":sign place 13 line=2 priority=100 name=s2\<CR>")
+ call term_sendkeys(buf, ":\<CR>")
+ call VerifyScreenDump(buf, 'Test_sign_cursor_6', {})
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestSigncolumn')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1556,
/**/
1555,
/**/