From 8de2328d2e712fc892d6f02d92feb88fa857e85b Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 26 Nov 2025 20:07:43 +0100 Subject: Fix find_prev_in_line It did not consider the starting location which made it not find the char it was standing on. This resulted in buffer_word_at returning the wrong thing. --- src/dged/buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dged') diff --git a/src/dged/buffer.c b/src/dged/buffer.c index 6337096..fed8f87 100644 --- a/src/dged/buffer.c +++ b/src/dged/buffer.c @@ -304,7 +304,8 @@ find_prev_in_line(struct buffer *buffer, struct location start, text_line_codepoint_iterator(buffer->text, start.line); uint32_t coli = 0, tab_width = get_tab_width(buffer), found_at; struct codepoint *codepoint; - while (coli < start.col && (codepoint = utf8_next_codepoint(&iter)) != NULL) { + while (coli <= start.col && + (codepoint = utf8_next_codepoint(&iter)) != NULL) { if (predicate(codepoint)) { found = true; found_at = coli; -- cgit v1.2.3