Mercurial > vim
diff src/testdir/test_textprop.vim @ 33868:25e5297fbc72 v9.0.2144
patch 9.0.2144: Text properties causes wrong line wrapping
Commit: https://github.com/vim/vim/commit/4e26a9aab6ad0ceb6bab0fd70e1031abb429f233
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Dec 3 17:50:47 2023 +0100
patch 9.0.2144: Text properties causes wrong line wrapping
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2023 15:16:08 +0100 |
parents | 0bb496f81ab2 |
children | 2c5ae1ce5af2 |
line wrap: on
line diff
--- 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