patch 8.1.0665: text property display wrong when 'spell' is set
Problem: Text property display wrong when 'spell' is set. (Dominique Pelle)
Solution: Remove unnecessary assignment to char_attr. Combine attributes if
needed. Add a screenshot test.
diff --git a/src/testdir/dumps/Test_textprop_01.dump b/src/testdir/dumps/Test_textprop_01.dump
new file mode 100644
index 0000000..ae80e53
--- /dev/null
+++ b/src/testdir/dumps/Test_textprop_01.dump
@@ -0,0 +1,20 @@
+| +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|e|r| |1+0#4040ff13#ffffff0|2|3| +0#0000000#ffff4012|a|n|d| |t|h|e|n| |4+0#4040ff13#ffffff0|5|6|7|.+0#0000000#ffff4012| +0&#ffffff0@45
+| +0#af5f00255&@1|3| |T+0#0000000#ffff4012|h|r|e+0&#ffffff0@1| @65
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 44e54bb..e938a58 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -5,6 +5,8 @@
finish
endif
+source screendump.vim
+
func Test_proptype_global()
call prop_type_add('comment', {'highlight': 'Directory', 'priority': 123, 'start_incl': 1, 'end_incl': 1})
let proptypes = prop_type_list()
@@ -283,5 +285,27 @@
call prop_type_delete('comment')
endfunc
+" screenshot test with textprop highlighting
+funct Test_textprop_screenshots()
+ if !CanRunVimInTerminal()
+ return
+ endif
+ call writefile([
+ \ "call setline(1, ['One two', 'Number 123 and then 4567.', 'Three'])",
+ \ "hi NumberProp ctermfg=blue",
+ \ "hi LongProp ctermbg=yellow",
+ \ "call prop_type_add('number', {'highlight': 'NumberProp'})",
+ \ "call prop_type_add('long', {'highlight': 'LongProp'})",
+ \ "call prop_add(1, 4, {'end_lnum': 3, 'end_col': 3, 'type': 'long'})",
+ \ "call prop_add(2, 8, {'length': 3, 'type': 'number'})",
+ \ "call prop_add(2, 21, {'length': 4, 'type': 'number'})",
+ \ "set number",
+ \ "set spell",
+ \], 'XtestProp')
+ let buf = RunVimInTerminal('-S XtestProp', {})
+ call VerifyScreenDump(buf, 'Test_textprop_01', {})
-" TODO: screenshot test with highlighting
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtest_folds_with_rnu')
+endfunc