aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-11-07 23:22:38 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-11-07 23:36:52 +0100
commit97f052ffd7b89f38452c3476c036001d5f6c56f3 (patch)
tree46c957f6a242f3d2956fc7277d1583d6bc47952e
parenta725325a002413142bd258d92970976db87d8399 (diff)
downloadvis-97f052ffd7b89f38452c3476c036001d5f6c56f3.tar.gz
vis-97f052ffd7b89f38452c3476c036001d5f6c56f3.tar.xz
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
-rw-r--r--text-motions.c4
1 files 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)