summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-03 17:50:47 +0100
committerChristian Brabandt <cb@256bit.org>2023-12-03 17:50:47 +0100
commit4e26a9aab6ad0ceb6bab0fd70e1031abb429f233 (patch)
tree87581217708b233d30ccb37f2258ab9045d0deae /src/testdir
parentc089c3816b7109a6f12bd8e7bdd7cba071ce840d (diff)
patch 9.0.2144: Text properties causes wrong line wrappingv9.0.2144
Problem: Text properties causes wrong line wrapping to be drawn. Solution: Find the index of the last text property that inserts text. closes: #13611 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/dumps/Test_prop_in_empty_popup.dump20
-rw-r--r--src/testdir/test_textprop.vim37
2 files changed, 57 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_prop_in_empty_popup.dump b/src/testdir/dumps/Test_prop_in_empty_popup.dump
new file mode 100644
index 0000000000..2bffc4b166
--- /dev/null
+++ b/src/testdir/dumps/Test_prop_in_empty_popup.dump
@@ -0,0 +1,20 @@
+> +0&#ffffff0@39
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @7|╔+0#0000000&|═@19|╗| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +8#af5f00255&@1|1| | +8#e000002&@15|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|║+0#0000000&| +0#4040ff13&@19|║+0#0000000&| +0#4040ff13&@8
+|~| @7|╚+0#0000000&|═@19|╝| +0#4040ff13&@8
+|~| @38
+|~| @38
+|~| @38
+| +0#0000000&@21|0|,|0|-|1| @8|A|l@1|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 086d12c7f6..e0bf814dff 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1424,6 +1424,43 @@ func Test_textprop_text_priority()
call StopVimInTerminal(buf)
endfunc
+func Test_textprop_in_empty_popup()
+ CheckScreendump
+
+ let lines =<< trim END
+ vim9script
+
+ hi def link FilterMenuMatch Constant
+ prop_type_add('FilterMenuMatch', {
+ highlight: "FilterMenuMatch",
+ override: true,
+ priority: 1000,
+ combine: true,
+ })
+
+ var winid = popup_create([{text: "hello", props: [
+ {col: 1, length: 1, type: 'FilterMenuMatch'},
+ {col: 2, length: 1, type: 'FilterMenuMatch'},
+ ]}], {
+ minwidth: 20,
+ minheight: 10,
+ cursorline: false,
+ highlight: "None",
+ border: [],
+ })
+
+ win_execute(winid, "setl nu cursorline cursorlineopt=both")
+ popup_settext(winid, [])
+ redraw
+ END
+ call writefile(lines, 'XtestPropEmptyPopup', 'D')
+ let buf = RunVimInTerminal('-S XtestPropEmptyPopup', #{rows: 20, cols: 40})
+ call VerifyScreenDump(buf, 'Test_prop_in_empty_popup', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_textprop_with_syntax()
CheckScreendump