diff options
author | pommicket <pommicket@gmail.com> | 2022-12-29 18:44:37 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-29 18:44:37 -0500 |
commit | d77782564bf0a090a4e7fa4f4c4bb685383275dc (patch) | |
tree | a4bc3c0bf142c663ea7f293b4381927adc896f1c /buffer.c | |
parent | 5f7af06a9085835a3d1ad3a51374c245859d7d97 (diff) |
textDocument/definition for ctrl+click
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } } |