Start with this text: <div id="animals >> mammals >> tigers">Hello</div>
(Note that the id
attribute of the div has some >
characters in it)
Put the cursor on the H
and then type vit
Vim selects > mammals >> tigers">Hello
Vim should select Hello
9.0.981
Operating system: mac 13.2.1
Terminal: kitty
$TERM: xterm-kitty
Shell: bash
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Wow, that is a very bad example. The following patch fixes it (will create a PR soon):
diff --git a/src/textobject.c b/src/textobject.c index 1890d7c83..aa2db0770 100644 --- a/src/textobject.c +++ b/src/textobject.c @@ -1426,15 +1426,22 @@ again: if (!do_include) { - // Exclude the start tag. + // Exclude the start tag, + // but skip over '>' if it appears in quotes + int in_quotes = FALSE; curwin->w_cursor = start_pos; while (inc_cursor() >= 0) - if (*ml_get_cursor() == '>') + { + p = ml_get_cursor(); + if (*p == '>' && !in_quotes) { inc_cursor(); start_pos = curwin->w_cursor; break; } + else if (*p == '"' || *p == '\'') + in_quotes = !in_quotes; + } curwin->w_cursor = end_pos; // If we are in Visual mode and now have the same text as before set
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #15043 as completed via ca7f93e.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.