diff options
author | pommicket <pommicket@gmail.com> | 2022-12-31 16:04:26 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-31 16:04:26 -0500 |
commit | ecca6666861f590ac17c68ea0b81ba0672667e65 (patch) | |
tree | 984e898163635e4fb5b8f81692d1d44946f15978 /command.c | |
parent | fd617d8d9723f76dcdb51b2fa54ef960be4edccc (diff) |
goto-definition-at-cursor command
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -292,7 +292,15 @@ void command_execute(Ted *ted, Command c, i64 argument) { case CMD_AUTOCOMPLETE_BACK: if (ted->autocomplete.open) autocomplete_prev(ted); - break; + break; + case CMD_GOTO_DEFINITION: + menu_open(ted, MENU_GOTO_DEFINITION); + break; + case CMD_GOTO_DEFINITION_AT_CURSOR: { + if (buffer && buffer_is_named_file(buffer)) { + buffer_goto_word_at_cursor(buffer); + } + } break; case CMD_FIND_USAGES: usages_find(ted); break; @@ -439,10 +447,7 @@ void command_execute(Ted *ted, Command c, i64 argument) { case CMD_GENERATE_TAGS: tags_generate(ted, true); break; - - case CMD_GOTO_DEFINITION: - menu_open(ted, MENU_GOTO_DEFINITION); - break; + case CMD_GOTO_LINE: menu_open(ted, MENU_GOTO_LINE); break; |