vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 89d3253a0f9503b062af9f6dc76c5b834f3eb0e9
parent 939648f56a5d55c8dc9a9d3f07ef32d39cf45226
Author: Javier Olaechea <pirata@gmail.com>
Date:   Wed, 16 May 2018 21:48:23 -0500

vis: make % motion match quotes and backticks as well

Close #703
Fix #670

Diffstat:
Mman/vis.1 | 2+-
Mvis-motions.c | 5++++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git 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 @@ -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);