summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-30 20:22:49 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-30 20:22:49 +0000
commit42eba04522d6be04393f59a9eab47833e7594650 (patch)
tree7f856ea77f39ef8a296644e11e92f917532c1485
parenteba3b7f6645c8f856132b4c06a009a3b0a44e21c (diff)
patch 8.2.3706: text property highlighting is used on Tabv8.2.3706
Problem: Text property highlighting is used on Tab. Solution: Only set in_linebreak when not on a Tab. (closes #9242)
-rw-r--r--src/drawline.c2
-rw-r--r--src/testdir/dumps/Test_prop_after_tab.dump10
-rw-r--r--src/testdir/test_textprop.vim18
-rw-r--r--src/version.c2
4 files changed, 31 insertions, 1 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 109b8b35ca..ae62be8f37 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -2046,7 +2046,7 @@ win_line(
c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
c_final = NUL;
- if (n_extra > 0)
+ if (n_extra > 0 && c != TAB)
in_linebreak = TRUE;
if (VIM_ISWHITE(c))
{
diff --git a/src/testdir/dumps/Test_prop_after_tab.dump b/src/testdir/dumps/Test_prop_after_tab.dump
new file mode 100644
index 0000000000..fd63d5e958
--- /dev/null
+++ b/src/testdir/dumps/Test_prop_after_tab.dump
@@ -0,0 +1,10 @@
+| +0&#ffffff0@6> |[+0#ffffff16#e000002|x+0#0000000#ffffff0@2|]| @61
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1|-|8| @8|A|l@1|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 546e2d6943..cc5d219ad5 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1633,6 +1633,24 @@ func Test_prop_in_linebreak()
call delete('XscriptPropLinebreak')
endfunc
+func Test_prop_after_tab()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set breakindent linebreak breakat+=]
+ call setline(1, "\t[xxx]")
+ call prop_type_add('test', #{highlight: 'ErrorMsg'})
+ call prop_add(1, 2, #{length: 1, type: 'test'})
+ END
+ call writefile(lines, 'XscriptPropAfterTab')
+ let buf = RunVimInTerminal('-S XscriptPropAfterTab', #{rows: 10})
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_prop_after_tab', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XscriptPropAfterTab')
+endfunc
+
" Buffer number of 0 should be ignored, as if the parameter wasn't passed.
def Test_prop_bufnr_zero()
new
diff --git a/src/version.c b/src/version.c
index 570cd2174c..601055a0e5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3706,
+/**/
3705,
/**/
3704,