aboutsummaryrefslogtreecommitdiff
path: root/text-motions.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-06 12:13:01 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-06 13:41:14 +0200
commit700ec992a2ed6fc16362052fb27933390fe2d7ee (patch)
tree8d5c2ea034cd7bcdee1dad6bcf3ac669c5ae6bbc /text-motions.c
parent7df8140a9ba4f0fbc2c55fa2de5eb789d878d4a0 (diff)
downloadvis-700ec992a2ed6fc16362052fb27933390fe2d7ee.tar.gz
vis-700ec992a2ed6fc16362052fb27933390fe2d7ee.tar.xz
text-motion: restore old text_{line_,}find_prev behavior
This partially reversts the "Fix to/till movements" commit 0d4093c3371079c5f75055338f0341f684542465 The pos += len hunk was interfering with other code which does not want this behavior. The original issue should be fixed directly within the to/till movements.
Diffstat (limited to 'text-motions.c')
-rw-r--r--text-motions.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/text-motions.c b/text-motions.c
index fd3e99a..18e727f 100644
--- a/text-motions.c
+++ b/text-motions.c
@@ -70,11 +70,9 @@ static size_t find_prev(Text *txt, size_t pos, const char *s, bool line) {
if (!s)
return pos;
size_t len = strlen(s), matched = len - 1;
- Iterator it, sit;
+ Iterator it = text_iterator_get(txt, pos), sit;
if (len == 0)
return pos;
- pos += len;
- it = text_iterator_get(txt, pos);
for (char c; text_iterator_byte_prev(&it, &c); ) {
if (c == s[matched]) {
if (matched == 0)