To: vim_dev@googlegroups.com Subject: Patch 8.2.1850 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1850 Problem: "vat" does not select tags correctly over line break. Solution: Adjust the search pattern. (Aufar Gilbran, closes #7136) Files: src/textobject.c, src/testdir/test_textobjects.vim *** ../vim-8.2.1849/src/textobject.c 2020-06-18 15:33:21.705578661 +0200 --- src/textobject.c 2020-10-15 21:19:05.984544136 +0200 *************** *** 1347,1353 **** curwin->w_cursor = old_pos; goto theend; } ! spat = alloc(len + 31); epat = alloc(len + 9); if (spat == NULL || epat == NULL) { --- 1347,1353 ---- curwin->w_cursor = old_pos; goto theend; } ! spat = alloc(len + 39); epat = alloc(len + 9); if (spat == NULL || epat == NULL) { *************** *** 1356,1362 **** curwin->w_cursor = old_pos; goto theend; } ! sprintf((char *)spat, "<%.*s\\>\\%%(\\s\\_[^>]\\{-}[^/]>\\|>\\)\\c", len, p); sprintf((char *)epat, "\\c", len, p); r = do_searchpair(spat, (char_u *)"", epat, FORWARD, NULL, --- 1356,1362 ---- curwin->w_cursor = old_pos; goto theend; } ! sprintf((char *)spat, "<%.*s\\>\\%%(\\_s\\_[^>]\\{-}\\_[^/]>\\|\\_s\\?>\\)\\c", len, p); sprintf((char *)epat, "\\c", len, p); r = do_searchpair(spat, (char_u *)"", epat, FORWARD, NULL, *** ../vim-8.2.1849/src/testdir/test_textobjects.vim 2020-07-30 20:08:46.840890218 +0200 --- src/testdir/test_textobjects.vim 2020-10-15 21:19:05.984544136 +0200 *************** *** 169,174 **** --- 169,186 ---- normal! k$vaty call assert_equal("\nwelcome\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 *** ../vim-8.2.1849/src/version.c 2020-10-15 20:42:16.418311117 +0200 --- src/version.c 2020-10-15 21:19:31.688480155 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1850, /**/ -- In order for something to become clean, something else must become dirty; but you can get everything dirty without getting anything clean. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///