diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-01-01 14:04:51 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-01 14:04:51 +0000 |
commit | 1aeb3eb092a384e63a407096102fd5a954aabeb8 (patch) | |
tree | e965467de0d657c517fe5b7e4cf31a5ac622acd9 | |
parent | 6bafdd41cbf8c06bc00f19dcf4e1c8292460b4dd (diff) | |
download | vim-git-1aeb3eb092a384e63a407096102fd5a954aabeb8.tar.gz |
patch 9.0.1124: virtual text at a column position is truncatedv9.0.1124
Problem: Virtual text at a column position is truncated at the window edge.
(Yegappan Lakshmanan)
Solution: Do not truncated virtual text that is placed at a column.
-rw-r--r-- | src/drawline.c | 2 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_with_wrap_1.dump | 6 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/drawline.c b/src/drawline.c index d8dc303e3..11cfb7782 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -643,7 +643,7 @@ text_prop_position( int right = (tp->tp_flags & TP_FLAG_ALIGN_RIGHT); int above = (tp->tp_flags & TP_FLAG_ALIGN_ABOVE); int below = (tp->tp_flags & TP_FLAG_ALIGN_BELOW); - int wrap = (tp->tp_flags & TP_FLAG_WRAP); + int wrap = tp->tp_col < MAXCOL || (tp->tp_flags & TP_FLAG_WRAP); int padding = tp->tp_col == MAXCOL && tp->tp_len > 1 ? tp->tp_len - 1 : 0; int col_with_padding = scr_col + (below ? 0 : padding); diff --git a/src/testdir/dumps/Test_prop_with_wrap_1.dump b/src/testdir/dumps/Test_prop_with_wrap_1.dump index c4bf86683..6b6d66470 100644 --- a/src/testdir/dumps/Test_prop_with_wrap_1.dump +++ b/src/testdir/dumps/Test_prop_with_wrap_1.dump @@ -1,6 +1,6 @@ ->a+0&#ffffff0|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|s+0#e000e06&|o|m|e| |v|i|… -|d+0#0000000&|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| @17 +|a+0&#ffffff0|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|s+0#e000e06&|o|m|e| |v|i|r +|t|u|a|l| |t|e|x|t|d+0#0000000&|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f> @8 |~+0#4040ff13&| @48 |~| @48 |~| @48 -| +0#0000000&@31|1|,|1| @10|A|l@1| +| +0#0000000&@31|1|,|7|5|-|9|2| @6|A|l@1| diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index a507a952c..f1c79845a 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -1978,6 +1978,7 @@ func Test_prop_with_wrap() setline(1, 'asdf '->repeat(15)) prop_type_add('test', {highlight: 'Special'}) prop_add(1, 43, {text: 'some virtual text', type: 'test'}) + normal G$ END call writefile(lines, 'XscriptPropWithWrap', 'D') let buf = RunVimInTerminal('-S XscriptPropWithWrap', #{rows: 6, cols: 50}) diff --git a/src/version.c b/src/version.c index 531d7bc3f..b49d71d8c 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1124, +/**/ 1123, /**/ 1122, |