mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.1745: Missing test coverage for blockwise Visual highlight
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>
This commit is contained in:
parent
c3172fe9e4
commit
fc3058495d
@ -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;
|
||||
|
@ -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|
|
||||
|
@ -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|
|
||||
|
@ -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|
|
||||
|
@ -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|
|
||||
|
@ -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|
|
||||
|
@ -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|
|
||||
|
@ -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|
|
||||
|
@ -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")
|
||||
|
@ -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', {})
|
||||
|
||||
|
@ -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', {})
|
||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1745,
|
||||
/**/
|
||||
1744,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user