aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Olaechea <pirata@gmail.com>2018-05-16 21:48:23 -0500
committerMarc André Tanner <mat@brain-dump.org>2018-05-17 22:31:29 +0200
commit668c49634d91d10809415720125a0033d3e31623 (patch)
tree6f535d370d5cac4b6d1da00b4e8b7a16c9a287ce
parent81c833832db791e5c269f0b3b4860ea33f40e769 (diff)
downloadvis-668c49634d91d10809415720125a0033d3e31623.tar.gz
vis-668c49634d91d10809415720125a0033d3e31623.tar.xz
vis: make % motion match quotes and backticks as well
Close #703 Fix #670
-rw-r--r--man/vis.12
-rw-r--r--vis-motions.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/man/vis.1 b/man/vis.1
index 13faa22..373fe45 100644
--- a/man/vis.1
+++ b/man/vis.1
@@ -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
diff --git a/vis-motions.c b/vis-motions.c
index 282c7dd..4103eab 100644
--- a/vis-motions.c
+++ b/vis-motions.c
@@ -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;
@@ -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);