From e728898cbb68f43472befc52b24318372b2e6159 Mon Sep 17 00:00:00 2001 From: John Vogel Date: Sun, 11 Sep 2022 19:51:20 -0400 Subject: partial revert of commit f55312ba 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 --- text-motions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text-motions.c b/text-motions.c index 1430d49..13aad19 100644 --- 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); } -- cgit v1.2.3