]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1745: Missing test coverage for blockwise Visual highlight v9.0.1745
authorzeertzjq <zeertzjq@outlook.com>
Sat, 19 Aug 2023 11:27:03 +0000 (13:27 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 19 Aug 2023 11:27:03 +0000 (13:27 +0200)
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>
12 files changed:
src/dict.c
src/testdir/dumps/Test_prop_inserts_text_visual_block_1.dump
src/testdir/dumps/Test_prop_inserts_text_visual_block_2.dump
src/testdir/dumps/Test_prop_inserts_text_visual_block_3.dump
src/testdir/dumps/Test_prop_inserts_text_visual_block_4.dump
src/testdir/dumps/Test_prop_inserts_text_visual_block_5.dump
src/testdir/dumps/Test_prop_inserts_text_visual_block_6.dump
src/testdir/dumps/Test_prop_inserts_text_visual_block_7.dump
src/testdir/test_conceal.vim
src/testdir/test_highlight.vim
src/testdir/test_textprop.vim
src/version.c

index ccd0b5dac2dc4295efc638614ea90fe4ab5757b8..ce807350cd1c6287a788bda4e74430aeea80f1fa 100644 (file)
@@ -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;
index ce82e3958dfd6c0f0c9ee58a41a3b5751a4bc6fd..15ebd1321fc1dea4a48acef08b98e1e1c5a84f88 100644 (file)
@@ -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| 
index 4fe696aa5dbc39fb8b0f5334e9a786982d32e892..2383b4a0a1890b886781189cb8adf8fb523e4de4 100644 (file)
@@ -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| 
index 27820c1f8f9a1e3957d3a536390e63363d74c16a..920cb1d7b9299e690773587817b1bbcbdfb335ad 100644 (file)
@@ -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| 
index 8db2dd2bd637efceec374bb0f235a3b1fbacab33..0017f0224084207e01bfdc756afb9cdd7b9897ce 100644 (file)
@@ -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| 
index 92418cc9ece60a43b870b5fd229d7d7d05359980..cb7e0c90af7e18e5483713f80f2332d8c7fc5292 100644 (file)
@@ -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| 
index 78ba81de2d2640d4d7fe7dca2c5d491632446805..c4be65f2985e6021765548b51d831fb58c6d6841 100644 (file)
@@ -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| 
index 7011db771556bad2836a770b5e5ed27b0c08b5a8..54c7fde43aa23970ac63718d67c6e89a03aa9458 100644 (file)
@@ -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| 
index 09b986f3396477d3912c577baa4a1c89feec9ae6..e9779213fd7b53afc5127e972491e2775353874a 100644 (file)
@@ -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")
index 22d066fecbe25c0fc1be36e709b14eb22bd31a51..6e39d4e3e021226774de5f95464f78d68990ed49 100644 (file)
@@ -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', {})
 
index d3a061d06a6d42d843a474e8885831cda553ce1a..da8c495ca13d0b1fdc31b893007f40f7e1d889d8 100644 (file)
@@ -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', {})
index c41db31b6e15e96f3d1a1333eff69a8f5b3976c0..05e7e03cfbd474085c6fe6c2f01dec315c4b94ce 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1745,
 /**/
     1744,
 /**/