diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-19 13:27:03 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-19 13:27:03 +0200 |
commit | fc3058495d3ff58c8f2b9dd4452d0840f2d1fa42 (patch) | |
tree | 127690c7f9017ca1239d10f551835db450edf787 /src | |
parent | c3172fe9e4d3ea7f705b5fc02fdb0c4ceb3df8b9 (diff) |
patch 9.0.1745: Missing test coverage for blockwise Visual highlightv9.0.1745
Problem: Missing test coverage for blockwise Visual highlight with
virtual that starts with a double-width char.
Solution: Add a new virtual text to the test. Some other small fixes.
closes: #12835
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/dict.c | 2 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_1.dump | 2 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_2.dump | 4 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_3.dump | 4 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_4.dump | 4 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_5.dump | 4 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_6.dump | 4 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_inserts_text_visual_block_7.dump | 4 | ||||
-rw-r--r-- | src/testdir/test_conceal.vim | 9 | ||||
-rw-r--r-- | src/testdir/test_highlight.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
12 files changed, 30 insertions, 18 deletions
diff --git a/src/dict.c b/src/dict.c index ccd0b5dac2..ce807350cd 100644 --- a/src/dict.c +++ b/src/dict.c @@ -1497,7 +1497,7 @@ dict2list(typval_T *argvars, typval_T *rettv, dict2list_T what) d = argvars[0].vval.v_dict; if (d == NULL) - // empty dict behaves like an empty dict + // NULL dict behaves like an empty dict return; todo = (int)d->dv_hashtab.ht_used; diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_1.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_1.dump index ce82e3958d..15ebd1321f 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_1.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_1.dump @@ -1,6 +1,6 @@ >1+0&#ffffff0|2|3|4|5|6|7|8|9| @50 |1|-+0#e000e06&|口*&|-+&|2+0#0000000&|3|4|5|6|7|8|9| @46 +|1|2|口*0#e000e06&|3+0#0000000&|4|5|6|7|8|9| @48 |1|2|3|4|5|6|7|8|9| @50 |~+0#4040ff13&| @58 -|~| @58 | +0#0000000&@41|1|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_2.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_2.dump index 4fe696aa5d..2383b4a0a1 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_2.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_2.dump @@ -1,6 +1,6 @@ |1+0&#e0e0e08|2|3+0&#ffffff0|4|5|6|7|8|9| @50 |1+0&#e0e0e08|-+0#e000e06#ffffff0|口*&|-+&|2+0#0000000&|3|4|5|6|7|8|9| @46 +|1+0&#e0e0e08|2|口*0#e000e06#ffffff0|3+0#0000000&|4|5|6|7|8|9| @48 |1+0&#e0e0e08>2+0&#ffffff0|3|4|5|6|7|8|9| @50 |~+0#4040ff13&| @58 -|~| @58 -|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|3|x|2| @6|3|,|2| @10|A|l@1| +|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|4|x|2| @6|4|,|2| @10|A|l@1| diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_3.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_3.dump index 27820c1f8f..920cb1d7b9 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_3.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_3.dump @@ -1,6 +1,6 @@ |1+0&#e0e0e08|2|3|4+0&#ffffff0|5|6|7|8|9| @50 |1+0&#e0e0e08|-+0#e000e06#ffffff0|口*&|-+&|2+0#0000000&|3|4|5|6|7|8|9| @46 +|1+0&#e0e0e08|2|口*0#e000e06#ffffff0|3+0#0000000&|4|5|6|7|8|9| @48 |1+0&#e0e0e08|2>3+0&#ffffff0|4|5|6|7|8|9| @50 |~+0#4040ff13&| @58 -|~| @58 -|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|3|x|3| @6|3|,|3| @10|A|l@1| +|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|4|x|3| @6|4|,|3| @10|A|l@1| diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_4.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_4.dump index 8db2dd2bd6..0017f02240 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_4.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_4.dump @@ -1,6 +1,6 @@ |1+0&#e0e0e08|2|3|4|5|6|7|8+0&#ffffff0|9| @50 |1+0&#e0e0e08|-+0#e000e06#ffffff0|口*&|-+&|2+0#0000000#e0e0e08|3|4+0&#ffffff0|5|6|7|8|9| @46 +|1+0&#e0e0e08|2|口*0#e000e06#ffffff0|3+0#0000000#e0e0e08|4|5|6+0&#ffffff0|7|8|9| @48 |1+0&#e0e0e08|2|3|4|5|6>7+0&#ffffff0|8|9| @50 |~+0#4040ff13&| @58 -|~| @58 -|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|3|x|7| @6|3|,|7| @10|A|l@1| +|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|4|x|7| @6|4|,|7| @10|A|l@1| diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_5.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_5.dump index 92418cc9ec..cb7e0c90af 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_5.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_5.dump @@ -1,6 +1,6 @@ |1+0&#ffffff0|2+0&#e0e0e08|3|4|5|6|7|8+0&#ffffff0|9| @50 |1|-+0#e000e06&|口*&|-+&|2+0#0000000#e0e0e08|3|4+0&#ffffff0|5|6|7|8|9| @46 +|1|2+0&#e0e0e08|口*0#e000e06#ffffff0|3+0#0000000#e0e0e08|4|5|6+0&#ffffff0|7|8|9| @48 |1>2|3+0&#e0e0e08|4|5|6|7|8+0&#ffffff0|9| @50 |~+0#4040ff13&| @58 -|~| @58 -|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|3|x|6| @6|3|,|2| @10|A|l@1| +|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|4|x|6| @6|4|,|2| @10|A|l@1| diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_6.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_6.dump index 78ba81de2d..c4be65f298 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_6.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_6.dump @@ -1,6 +1,6 @@ |1+0&#ffffff0|2|3+0&#e0e0e08|4|5|6|7|8+0&#ffffff0|9| @50 |1|-+0#e000e06&|口*&|-+&|2+0#0000000#e0e0e08|3|4+0&#ffffff0|5|6|7|8|9| @46 +|1|2|口*0#e000e06&|3+0#0000000#e0e0e08|4|5|6+0&#ffffff0|7|8|9| @48 |1|2>3|4+0&#e0e0e08|5|6|7|8+0&#ffffff0|9| @50 |~+0#4040ff13&| @58 -|~| @58 -|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|3|x|5| @6|3|,|3| @10|A|l@1| +|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|4|x|5| @6|4|,|3| @10|A|l@1| diff --git a/src/testdir/dumps/Test_prop_inserts_text_visual_block_7.dump b/src/testdir/dumps/Test_prop_inserts_text_visual_block_7.dump index 7011db7715..54c7fde43a 100644 --- a/src/testdir/dumps/Test_prop_inserts_text_visual_block_7.dump +++ b/src/testdir/dumps/Test_prop_inserts_text_visual_block_7.dump @@ -1,6 +1,6 @@ |1+0&#ffffff0|2|3|4+0&#e0e0e08|5|6|7|8+0&#ffffff0|9| @50 |1|-+0#e000e06&|口*&|-+&|2+0#0000000#e0e0e08|3|4+0&#ffffff0|5|6|7|8|9| @46 +|1|2|口*0#e000e06&|3+0#0000000#e0e0e08|4|5|6+0&#ffffff0|7|8|9| @48 |1|2|3>4|5+0&#e0e0e08|6|7|8+0&#ffffff0|9| @50 |~+0#4040ff13&| @58 -|~| @58 -|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|3|x|4| @6|3|,|4| @10|A|l@1| +|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@13|4|x|4| @6|4|,|4| @10|A|l@1| diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim index 09b986f339..e9779213fd 100644 --- a/src/testdir/test_conceal.vim +++ b/src/testdir/test_conceal.vim @@ -347,6 +347,10 @@ func Test_conceal_mouse_click() redraw call assert_equal(['conceal click here '], ScreenLines(1, 20)) + " click on the space between "this" and "click" puts cursor there + call test_setmouse(1, 9) + call feedkeys("\<LeftMouse>", "tx") + call assert_equal([0, 1, 13, 0, 13], getcurpos()) " click on 'h' of "here" puts cursor there call test_setmouse(1, 16) call feedkeys("\<LeftMouse>", "tx") @@ -373,6 +377,11 @@ func Test_conceal_mouse_click() call assert_equal([0, 1, 23, 0, 36], getcurpos()) set virtualedit=all + redraw + " click on the space between "this" and "click" puts cursor there + call test_setmouse(1, 9) + call feedkeys("\<LeftMouse>", "tx") + call assert_equal([0, 1, 13, 0, 13], getcurpos()) " click on 'h' of "here" puts cursor there call test_setmouse(1, 16) call feedkeys("\<LeftMouse>", "tx") diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim index 22d066fecb..6e39d4e3e0 100644 --- a/src/testdir/test_highlight.vim +++ b/src/testdir/test_highlight.vim @@ -744,8 +744,8 @@ func Test_colorcolumn_sbr() let lines =<< trim END call setline(1, 'The quick brown fox jumped over the lazy dogs') END - call writefile(lines, 'Xtest_colorcolumn_srb', 'D') - let buf = RunVimInTerminal('-S Xtest_colorcolumn_srb', {'rows': 10,'columns': 40}) + call writefile(lines, 'Xtest_colorcolumn_sbr', 'D') + let buf = RunVimInTerminal('-S Xtest_colorcolumn_sbr', {'rows': 10,'columns': 40}) call term_sendkeys(buf, ":set co=40 showbreak=+++>\\ cc=40,41,43\<CR>") call VerifyScreenDump(buf, 'Test_colorcolumn_3', {}) diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index d3a061d06a..da8c495ca1 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2606,14 +2606,15 @@ func Test_prop_inserts_text_visual_block() CheckRunVimInTerminal let lines =<< trim END - call setline(1, repeat(['123456789'], 3)) + call setline(1, repeat(['123456789'], 4)) call prop_type_add('theprop', #{highlight: 'Special'}) call prop_add(2, 2, {'type': 'theprop', 'text': '-口-'}) + call prop_add(3, 3, {'type': 'theprop', 'text': '口'}) END call writefile(lines, 'XscriptPropsVisualBlock', 'D') let buf = RunVimInTerminal('-S XscriptPropsVisualBlock', #{rows: 6, cols: 60}) call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_1', {}) - call term_sendkeys(buf, "\<C-V>2jl") + call term_sendkeys(buf, "\<C-V>3jl") call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_2', {}) call term_sendkeys(buf, "l") call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_3', {}) diff --git a/src/version.c b/src/version.c index c41db31b6e..05e7e03cfb 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 */ /**/ + 1745, +/**/ 1744, /**/ 1743, |