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 #3332)
diff --git a/src/testdir/test_textobjects.vim b/src/testdir/test_textobjects.vim
index f02619f..6a2f504 100644
--- a/src/testdir/test_textobjects.vim
+++ b/src/testdir/test_textobjects.vim
@@ -121,6 +121,23 @@
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))