From f319e4608eb544a1c3ca930095a316acf0768a10 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 15 Oct 2020 19:04:25 -0400 Subject: 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. --- src/nvim/testdir/test_textobjects.vim | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/nvim/testdir/test_textobjects.vim') 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('-', getline('.')) + " copy the tag block from leading indentation before the start tag + let t = " \ntext\n" + $put =t + normal! 2kvaty + call assert_equal("\ntext\n", @") + + " copy the tag block from the end tag + let t = "\nwelcome\n" + $put =t + normal! $vaty + call assert_equal("\nwelcome\n", @") + + " copy the outer tag block from a tag without an end tag + let t = "\nwelcome\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 -- cgit