summaryrefslogtreecommitdiff
path: root/src/main/lsp/completion.c
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2025-11-28 11:32:31 +0100
committerAlbert Cervin <albert@acervin.com>2025-11-28 11:32:31 +0100
commit46e2807671dd1305107f4121419d2d36498b0535 (patch)
treee3e81cddfc2d10cadae42b6354c8e2837604d046 /src/main/lsp/completion.c
parent850916c62217d2bdcdc943e7238175954e3d1d5e (diff)
downloaddged-46e2807671dd1305107f4121419d2d36498b0535.tar.gz
dged-46e2807671dd1305107f4121419d2d36498b0535.tar.xz
dged-46e2807671dd1305107f4121419d2d36498b0535.zip
Fix offset for detecting current symbol in lsp
Diffstat (limited to 'src/main/lsp/completion.c')
-rw-r--r--src/main/lsp/completion.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/lsp/completion.c b/src/main/lsp/completion.c
index 8a41285..51164e1 100644
--- a/src/main/lsp/completion.c
+++ b/src/main/lsp/completion.c
@@ -29,7 +29,8 @@ struct symbol {
};
static struct symbol current_symbol(struct buffer *buffer, struct location at) {
- struct region word = buffer_word_at(buffer, at);
+ // use previous char here since the cursor has moved after typing
+ struct region word = buffer_word_at(buffer, buffer_previous_char(buffer, at));
if (!region_has_size(word)) {
return (struct symbol){
.symbol =