summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index 4562219..679da65 100644
--- a/buffer.c
+++ b/buffer.c
@@ -2489,12 +2489,14 @@ bool buffer_handle_click(Ted *ted, TextBuffer *buffer, v2 click, u8 times) {
break;
case KEY_MODIFIER_CTRL:
if (!buffer->is_line_buffer) {
+ // go to definition
buffer_cursor_move_to_pos(buffer, buffer_pos);
String32 word = buffer_word_at_cursor(buffer);
if (word.len) {
char *tag = str32_to_utf8_cstr(word);
if (tag) {
- tag_goto(buffer->ted, tag);
+ LSPDocumentPosition pos = buffer_pos_to_lsp_document_position(buffer, buffer_pos);
+ definition_goto(buffer->ted, buffer_lsp(buffer), tag, pos);
free(tag);
}
}