vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 2f563197937c86ebb1655e9072fb6de484c31b38
parent ab52c130632adc1116482079c7a59bae901afc33
Author: John Vogel <jvogel4@stny.rr.com>
Date: Sun, 11 Sep 2022 19:51:20 -0400
partial revert of commit 5bf5a671
text_paragraph_prev():
Bring back the previous usage of text_iterator_byte_get() in the
while conditional and text_iterator_char_prev() in the loop body.
Fixes #1028 - { moves back a paragraph too much if cursor at start of line
Diffstat:
| M | text-motions.c | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/text-motions.c b/text-motions.c @@ -459,7 +459,8 @@ size_t text_paragraph_prev(Text *txt, size_t pos) { char c; Iterator it = text_iterator_get(txt, pos); - while (text_iterator_byte_prev(&it, &c) && (c == '\n' || blank(c))); + while (text_iterator_byte_get(&it, &c) && (c == '\n' || blank(c))) + text_iterator_char_prev(&it, NULL); return text_line_blank_prev(txt, it.pos); }