Skip to content

Commit 82260af

Browse files
committed
patch 8.1.2189: syntax highlighting wrong for tab
Problem: Syntax highlighting wrong for tab. Solution: Don't clear syntax attribute n_extra is non-zero.
1 parent 2b78ab5 commit 82260af

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/drawline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,9 +1400,9 @@ win_line(
14001400
#endif
14011401

14021402
#ifdef FEAT_SYN_HL
1403-
syntax_attr = 0;
14041403
if (extra_check && n_extra == 0)
14051404
{
1405+
syntax_attr = 0;
14061406
# ifdef FEAT_TERMINAL
14071407
if (get_term_attr)
14081408
syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol);

src/testdir/dumps/Test_syntax_c_01.dump

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
| +0&#e0e0e08@2|p|r|i|n|t|f|(|"+0#e000002&|J|u|s|t| |a|n| |e|x|a|m|p|l|e| |p|i|e|c|e| |o|f| >C+0&#ffffff0| |c|o|d|e|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @27
1111
@3|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|0+0#e000002&|x|0|f@1|;+0#0000000&| @58
1212
|}| @73
13+
| +0#ffffff16#ff404010@16| +0#0000000#ffffff0@57
1314
@3|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&@60
1415
|m|y|F|u|n|c|t|i|o|n|(|c+0#00e0003&|o|n|s|t| +0#0000000&|d+0#00e0003&|o|u|b|l|e| +0#0000000&|c|o|u|n|t|,| |s+0#00e0003&|t|r|u|c|t| +0#0000000&|n|o|t|h|i|n|g|,| |l+0#00e0003&|o|n|g| +0#0000000&|t|h|e|r|e|)| |{| @14
1516
@8|/+0#0000e05&@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |e+0&#ffff4012|n|d|i|f| +0&#ffffff0|h|e|r|e| +0#0000000&@37
@@ -18,5 +19,4 @@
1819
@8|}| @65
1920
@8|N+0&#ffff4012|o|t|e|:+0&#ffffff0| |a|s|d|f| @56
2021
|}| @73
21-
|~+0#4040ff13&| @73
22-
|-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1|
22+
|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1|

src/testdir/test_syntax.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ func Test_syntax_c()
549549
\ ' printf("Just an example piece of C code\n");',
550550
\ ' return 0x0ff;',
551551
\ '}',
552+
\ "\t\t ",
552553
\ ' static void',
553554
\ 'myFunction(const double count, struct nothing, long there) {',
554555
\ "\t// 123: nothing to endif here",
@@ -565,6 +566,7 @@ func Test_syntax_c()
565566

566567
let buf = RunVimInTerminal('Xtest.c', #{rows: 22})
567568
call term_sendkeys(buf, ":syn keyword Search Note\r")
569+
call term_sendkeys(buf, ":syn match Error /^\\s\\+$/\r")
568570
call term_sendkeys(buf, ":set hlsearch\r")
569571
call term_sendkeys(buf, "/endif\r")
570572
call term_sendkeys(buf, "vjfC")

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
2189,
744746
/**/
745747
2188,
746748
/**/

0 commit comments

Comments
 (0)