summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-17 13:05:07 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-17 13:05:07 +0200
commitbfd451283f8c37926f4b0aa22b74b534bd84e482 (patch)
tree10b60e88040d935de174aa80cfca48f87655d91a
parentdabfde04fe974b444d08715178c619c99c2cdcd8 (diff)
downloadvim-git-bfd451283f8c37926f4b0aa22b74b534bd84e482.tar.gz
patch 8.1.1340: attributes from 'cursorline' overwrite textpropv8.1.1340
Problem: Attributes from 'cursorline' overwrite textprop. Solution: Combine the attributes. (closes #3912)
-rw-r--r--src/screen.c8
-rw-r--r--src/testdir/dumps/Test_textprop_01.dump2
-rw-r--r--src/testdir/test_textprop.vim2
-rw-r--r--src/textprop.c3
-rw-r--r--src/version.c2
5 files changed, 10 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c
index cab697fd2..e6c0b2b3d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4306,11 +4306,15 @@ win_line(
char_attr = hl_combine_attr(line_attr, area_attr);
else if (search_attr != 0)
char_attr = hl_combine_attr(line_attr, search_attr);
- /* Use line_attr when not in the Visual or 'incsearch' area
- * (area_attr may be 0 when "noinvcur" is set). */
+# ifdef FEAT_TEXT_PROP
+ else if (text_prop_type != NULL)
+ char_attr = hl_combine_attr(line_attr, text_prop_attr);
+# endif
else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL)
|| vcol < fromcol || vcol_prev < fromcol_prev
|| vcol >= tocol))
+ // Use line_attr when not in the Visual or 'incsearch' area
+ // (area_attr may be 0 when "noinvcur" is set).
char_attr = line_attr;
#else
if (area_attr != 0)
diff --git a/src/testdir/dumps/Test_textprop_01.dump b/src/testdir/dumps/Test_textprop_01.dump
index 002062e2c..bda2a56f0 100644
--- a/src/testdir/dumps/Test_textprop_01.dump
+++ b/src/testdir/dumps/Test_textprop_01.dump
@@ -1,6 +1,6 @@
| +0#af5f00255#ffffff0@1|1| |O+0#0000000&|n|e| +0&#ffff4012|t|w|o| +0&#ffffff0@63
| +0#af5f00255&@1|2| |N+0#0000000#ffff4012|u|m|b|é|r| |1+0#4040ff13&|2|3| +0#0000000&|ä|n|d| |t|h|œ|n| |4+0#4040ff13&|¾|7|.+0#0000000&| +0&#ffffff0@46
-| +0#af5f00255&@1|3| >-+0#0000000#ffff4012|x+0&#ffffff0|a+0#4040ff13&@1|x+0#0000000&|-@1|x+0#4040ff13&|b@1|x+0#0000000&|-@1|x|c+0#4040ff13&@1|x|-+0#0000000&@1|x+0#4040ff13&|d@1|x|-+0#0000000&@1| @45
+| +0#af5f00255&@1|3| >-+8#0000000#ffff4012|x+8&#ffffff0|a+8#4040ff13&@1|x+8#0000000&|-@1|x+8#4040ff13&|b@1|x+8#0000000&|-@1|x|c+8#4040ff13&@1|x|-+8#0000000&@1|x+8#4040ff13&|d@1|x|-+8#0000000&@1| @45
| +0#af5f00255&@1|4| |/+0#40ff4011&@1| |c|o|m@1|e|n|t| |w+0&#e0e0e08|i|t|h| |e+8&&|r@1|o|r| +0&#ffffff0|i|n| |i|t| +0#0000000&@43
|~+0#4040ff13&| @73
|~| @73
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 237eda95f..dc229c019 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -645,7 +645,7 @@ funct Test_textprop_screenshots()
\ "call prop_add(3, 15, {'length': 2, 'type': 'both'})",
\ "call prop_add(4, 12, {'length': 10, 'type': 'background'})",
\ "call prop_add(4, 17, {'length': 5, 'type': 'error'})",
- \ "set number",
+ \ "set number cursorline",
\ "hi clear SpellBad",
\ "set spell",
\ "syn match Comment '//.*'",
diff --git a/src/textprop.c b/src/textprop.c
index 361ecb126..4c78ff11c 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -11,10 +11,7 @@
* Text properties implementation. See ":help text-properties".
*
* TODO:
- * - When using 'cursorline' attributes should be merged. (#3912)
* - Adjust text property column and length when text is inserted/deleted.
- * -> splitting a line can create a zero-length property. Don't highlight it
- * and extend it when inserting text.
* -> a :substitute with a multi-line match
* -> join two lines, also with BS in Insert mode
* -> search for changed_bytes() from misc1.c
diff --git a/src/version.c b/src/version.c
index 849676720..309ed3c09 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1340,
+/**/
1339,
/**/
1338,