summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2025-11-26 20:07:43 +0100
committerAlbert Cervin <albert@acervin.com>2025-11-26 20:07:43 +0100
commit8de2328d2e712fc892d6f02d92feb88fa857e85b (patch)
tree22a710957ed42cee9bb3afef93f42d2e72106d9f /src
parenta4056eb9de575463ccc9f53db8952e49801a8cf3 (diff)
downloaddged-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')
-rw-r--r--src/dged/buffer.c3
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;