diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-01-27 18:42:21 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-01-27 18:44:18 +0100 |
| commit | 84eeabfef92559cb71233bf69db4f1b1fd4f9cd8 (patch) | |
| tree | d0b935dbe0ab6925deba1fa8a0f64dd1352529b0 /text-motions.c | |
| parent | e2c6526a97018f695d3d2e9a420c36bd2797b37b (diff) | |
| download | vis-84eeabfef92559cb71233bf69db4f1b1fd4f9cd8.tar.gz vis-84eeabfef92559cb71233bf69db4f1b1fd4f9cd8.tar.xz | |
text-motion: change text_bracket_match API
Diffstat (limited to 'text-motions.c')
| -rw-r--r-- | text-motions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/text-motions.c b/text-motions.c index 550466b..f406da3 100644 --- a/text-motions.c +++ b/text-motions.c @@ -550,17 +550,17 @@ size_t text_function_end_prev(Text *txt, size_t pos) { } size_t text_bracket_match(Text *txt, size_t pos) { - return text_bracket_match_except(txt, pos, NULL); + return text_bracket_match_symbol(txt, pos, NULL); } -size_t text_bracket_match_except(Text *txt, size_t pos, const char *except) { +size_t text_bracket_match_symbol(Text *txt, size_t pos, const char *symbols) { int direction, count = 1; char search, current, c; bool instring = false; Iterator it = text_iterator_get(txt, pos); if (!text_iterator_byte_get(&it, ¤t)) return pos; - if (except && memchr(except, current, strlen(except))) + if (symbols && !memchr(symbols, current, strlen(symbols))) return pos; switch (current) { case '(': search = ')'; direction = 1; break; |
