Skip to content

Commit

Permalink
partial revert of commit f55312b
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jvvv authored and rnpnr committed Jul 16, 2023
1 parent 424b219 commit e728898
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion text-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e728898

Please sign in to comment.