mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:8.1.0290: "cit" on an empty HTML tag changes the whole tag
Problem: "cit" on an empty HTML tag changes the whole tag.
Solution: Only adjust the area in Visual mode. (Andy Massimino,
closes vim/vim#3332)
b476cb7d8d
This commit is contained in:
@@ -3445,9 +3445,11 @@ again:
|
||||
}
|
||||
curwin->w_cursor = end_pos;
|
||||
|
||||
/* If we now have the same text as before reset "do_include" and try
|
||||
* again. */
|
||||
if (equalpos(start_pos, old_start) && equalpos(end_pos, old_end)) {
|
||||
// If we are in Visual mode and now have the same text as before set
|
||||
// "do_include" and try again.
|
||||
if (VIsual_active
|
||||
&& equalpos(start_pos, old_start)
|
||||
&& equalpos(end_pos, old_end)) {
|
||||
do_include = TRUE;
|
||||
curwin->w_cursor = old_start;
|
||||
count = count_arg;
|
||||
|
@@ -121,6 +121,23 @@ func Test_string_html_objects()
|
||||
enew!
|
||||
endfunc
|
||||
|
||||
func Test_empty_html_tag()
|
||||
new
|
||||
call setline(1, '<div></div>')
|
||||
normal 0citxxx
|
||||
call assert_equal('<div>xxx</div>', getline(1))
|
||||
|
||||
call setline(1, '<div></div>')
|
||||
normal 0f<cityyy
|
||||
call assert_equal('<div>yyy</div>', getline(1))
|
||||
|
||||
call setline(1, '<div></div>')
|
||||
normal 0f<vitsaaa
|
||||
call assert_equal('aaa', getline(1))
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Tests for match() and matchstr()
|
||||
func Test_match()
|
||||
call assert_equal("b", matchstr("abcd", ".", 0, 2))
|
||||
|
Reference in New Issue
Block a user