diff options
| author | Albert Cervin <albert@acervin.com> | 2025-11-26 20:07:43 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2025-11-26 20:07:43 +0100 |
| commit | 8de2328d2e712fc892d6f02d92feb88fa857e85b (patch) | |
| tree | 22a710957ed42cee9bb3afef93f42d2e72106d9f /src/dged | |
| parent | a4056eb9de575463ccc9f53db8952e49801a8cf3 (diff) | |
| download | dged-8de2328d2e712fc892d6f02d92feb88fa857e85b.tar.gz dged-8de2328d2e712fc892d6f02d92feb88fa857e85b.tar.xz dged-8de2328d2e712fc892d6f02d92feb88fa857e85b.zip | |
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.
Diffstat (limited to 'src/dged')
| -rw-r--r-- | src/dged/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |
