From 97f052ffd7b89f38452c3476c036001d5f6c56f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 7 Nov 2015 23:22:38 +0100 Subject: text-motion: do not treat ' as string delimiter in match bracket Currently symbols inside a string are ignored. This means that if the opening (closing) symbol is inside (outside) the string while the closing (opening) one is outside (inside), it will not be matched. It is not yet clear whether this "optimization" is useful. Closes #97 --- text-motions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text-motions.c b/text-motions.c index aa779b2..cde74cc 100644 --- a/text-motions.c +++ b/text-motions.c @@ -590,7 +590,7 @@ size_t text_bracket_match_except(Text *txt, size_t pos, const char *except) { if (direction >= 0) { /* forward search */ while (text_iterator_byte_next(&it, &c)) { - if (c != current && (c == '"' || c == '\'')) + if (c != current && c == '"') instring = !instring; if (!instring) { if (c == search && --count == 0) @@ -601,7 +601,7 @@ size_t text_bracket_match_except(Text *txt, size_t pos, const char *except) { } } else { /* backwards */ while (text_iterator_byte_prev(&it, &c)) { - if (c != current && (c == '"' || c == '\'')) + if (c != current && c == '"') instring = !instring; if (!instring) { if (c == search && --count == 0) -- cgit v1.2.3