diff src/textobject.c @ 22604:3ac0ef0578ef v8.2.1850

patch 8.2.1850: "vat" does not select tags correctly over line break Commit: https://github.com/vim/vim/commit/a604ccc959c3bff88d3d5bc3c965819fc326d239 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 15 21:23:28 2020 +0200 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 https://github.com/vim/vim/issues/7136)
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Oct 2020 21:30:04 +0200
parents 56c86b167b68
children d4a710f06f02
line wrap: on
line diff
--- a/src/textobject.c
+++ b/src/textobject.c
@@ -1347,7 +1347,7 @@ again:
 	curwin->w_cursor = old_pos;
 	goto theend;
     }
-    spat = alloc(len + 31);
+    spat = alloc(len + 39);
     epat = alloc(len + 9);
     if (spat == NULL || epat == NULL)
     {
@@ -1356,7 +1356,7 @@ again:
 	curwin->w_cursor = old_pos;
 	goto theend;
     }
-    sprintf((char *)spat, "<%.*s\\>\\%%(\\s\\_[^>]\\{-}[^/]>\\|>\\)\\c", len, p);
+    sprintf((char *)spat, "<%.*s\\>\\%%(\\_s\\_[^>]\\{-}\\_[^/]>\\|\\_s\\?>\\)\\c", len, p);
     sprintf((char *)epat, "</%.*s>\\c", len, p);
 
     r = do_searchpair(spat, (char_u *)"", epat, FORWARD, NULL,