diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-10-09 21:53:58 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-10-09 21:53:58 +0100 |
commit | f167c7b42476f8ab5b32c3c5ccbdca914316e96b (patch) | |
tree | 30120a4fd000882fbfdc8dc37ef32f63246c61b3 /src/testdir | |
parent | 15b314ffbb93f934b72cb71aa8f881caea026256 (diff) | |
download | vim-git-f167c7b42476f8ab5b32c3c5ccbdca914316e96b.tar.gz |
patch 9.0.0709: virtual text "after" not correct with 'nowrap'v9.0.0709
Problem: Virtual text "after" not correct with 'nowrap'.
Solution: Do not display "after" text prop on the next line when 'wrap' is
off.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_text_after_nowrap_1.dump | 8 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 30 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_text_after_nowrap_1.dump b/src/testdir/dumps/Test_text_after_nowrap_1.dump new file mode 100644 index 000000000..d8711b84c --- /dev/null +++ b/src/testdir/dumps/Test_text_after_nowrap_1.dump @@ -0,0 +1,8 @@ +|f+0&#ffffff0|i|r|s|t| |l|i|n|e| @1|a+0&#ffd7ff255|f|t|e|r| |t|h|e| |t|e|x|t| |a|f|t|e|r| |t|h|e| |t|e|x|t| |a|f|t|e|r| |t|h|e| |t|e|x|t| |a|f|t +|s+0&#ffffff0|e|c|o|n|d| >l|i|n|e| |s|e|c|o|n|d| |l|i|n|e| |s|e|c|o|n|d| |l|i|n|e| |s|e|c|o|n|d| |l|i|n|e| |s|e|c|o|n|d| |l|i|n|e| +|t|h|i|r|d| @54 +|f|o|u|r|t|h| @53 +|~+0#4040ff13&| @58 +|~| @58 +|~| @58 +| +0#0000000&@41|2|,|8| @10|A|l@1| diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index ed0aac88c..5b0dce829 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -3211,6 +3211,36 @@ func Test_long_text_below_with_padding() call StopVimInTerminal(buf) endfunc +func Test_text_after_nowrap() + CheckRunVimInTerminal + + " FIXME: the second property causes a hang + let lines =<< trim END + vim9script + setline(1, ['first line', 'second line '->repeat(50), 'third', 'fourth']) + set nowrap + prop_type_add('theprop', {highlight: 'DiffChange'}) + prop_add(1, 0, { + type: 'theprop', + text: 'after the text '->repeat(5), + text_align: 'after', + text_padding_left: 2, + }) + #prop_add(1, 0, { + # type: 'theprop', + # text: 'after the text '->repeat(5), + # text_align: 'after', + # text_padding_left: 2, + #}) + normal 2Gw + END + call writefile(lines, 'XTextAfterNowrap', 'D') + let buf = RunVimInTerminal('-S XTextAfterNowrap', #{rows: 8, cols: 60}) + call VerifyScreenDump(buf, 'Test_text_after_nowrap_1', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_insert_text_change_arg() CheckRunVimInTerminal |