Skip to content

Commit

Permalink
vis: make % motion match quotes and backticks as well
Browse files Browse the repository at this point in the history
  • Loading branch information
PuercoPop authored and martanne committed May 17, 2018
1 parent 81c8338 commit 668c496
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion man/vis.1
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ char right
goto bottom/last line of window
.
.It Ic %
match bracket
match bracket, quote or backtick
.
.It Ic }
next paragraph
Expand Down
5 changes: 4 additions & 1 deletion vis-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static size_t window_nop(Vis *vis, Win *win, size_t pos) {
}

static size_t bracket_match(Text *txt, size_t pos) {
size_t hit = text_bracket_match_symbol(txt, pos, "(){}[]<>");
size_t hit = text_bracket_match_symbol(txt, pos, "(){}[]<>'\"`");
if (hit != pos)
return hit;
char current;
Expand All @@ -196,6 +196,9 @@ static size_t bracket_match(Text *txt, size_t pos) {
case ']':
case '<':
case '>':
case '"':
case '\'':
case '`':
return it.pos;
}
text_iterator_byte_next(&it, NULL);
Expand Down

0 comments on commit 668c496

Please sign in to comment.