aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-15 19:04:25 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-15 22:51:10 -0400
commitf319e4608eb544a1c3ca930095a316acf0768a10 (patch)
treef5c4dee1ac617382716b720691bd6ba353fe4b5a /src/nvim/testdir
parent3566244d0e90d1efcf50d5136ab77d9a19aea9a1 (diff)
downloadrneovim-f319e4608eb544a1c3ca930095a316acf0768a10.tar.gz
rneovim-f319e4608eb544a1c3ca930095a316acf0768a10.tar.bz2
rneovim-f319e4608eb544a1c3ca930095a316acf0768a10.zip
vim-patch:8.2.1850: "vat" does not select tags correctly over line break
Problem: "vat" does not select tags correctly over line break. Solution: Adjust the search pattern. (Aufar Gilbran, closes vim/vim#7136) https://github.com/vim/vim/commit/a604ccc959c3bff88d3d5bc3c965819fc326d239 Use 'const char*' for spat,mpat,epat params of do_searchpair() to reduce (char_u *) casts. Cherry-pick Test_string_html_objects() changes from patch 8.2.0655.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_textobjects.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textobjects.vim b/src/nvim/testdir/test_textobjects.vim
index 7863317eb0..f70cc1f70a 100644
--- a/src/nvim/testdir/test_textobjects.vim
+++ b/src/nvim/testdir/test_textobjects.vim
@@ -152,6 +152,36 @@ func Test_string_html_objects()
normal! dit
call assert_equal('-<b></b>', getline('.'))
+ " copy the tag block from leading indentation before the start tag
+ let t = " <b>\ntext\n</b>"
+ $put =t
+ normal! 2kvaty
+ call assert_equal("<b>\ntext\n</b>", @")
+
+ " copy the tag block from the end tag
+ let t = "<title>\nwelcome\n</title>"
+ $put =t
+ normal! $vaty
+ call assert_equal("<title>\nwelcome\n</title>", @")
+
+ " copy the outer tag block from a tag without an end tag
+ let t = "<html>\n<title>welcome\n</html>"
+ $put =t
+ normal! k$vaty
+ call assert_equal("<html>\n<title>welcome\n</html>", @")
+
+ " nested tag that has < in a different line from >
+ let t = "<div><div\n></div></div>"
+ $put =t
+ normal! k0vaty
+ call assert_equal("<div><div\n></div></div>", @")
+
+ " nested tag with attribute that has < in a different line from >
+ let t = "<div><div\nattr=\"attr\"\n></div></div>"
+ $put =t
+ normal! 2k0vaty
+ call assert_equal("<div><div\nattr=\"attr\"\n></div></div>", @")
+
set quoteescape&
enew!
endfunc