From 87c8bd6eb27edb4bfc539967235c3a1e2f8d77e4 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 3 Jan 2023 17:29:19 -0500 Subject: go to declaration --- command.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index fb9a390..bf26b3a 100644 --- a/command.c +++ b/command.c @@ -66,6 +66,7 @@ static CommandName const command_names[] = { {"find-usages", CMD_FIND_USAGES}, {"goto-definition", CMD_GOTO_DEFINITION}, {"goto-definition-at-cursor", CMD_GOTO_DEFINITION_AT_CURSOR}, + {"goto-declaration-at-cursor", CMD_GOTO_DECLARATION_AT_CURSOR}, {"find", CMD_FIND}, {"find-replace", CMD_FIND_REPLACE}, {"tab-close", CMD_TAB_CLOSE}, @@ -405,10 +406,15 @@ void command_execute(Ted *ted, Command c, i64 argument) { break; case CMD_GOTO_DEFINITION: menu_open(ted, MENU_GOTO_DEFINITION); - break; + break; case CMD_GOTO_DEFINITION_AT_CURSOR: { if (buffer && buffer_is_named_file(buffer)) { - buffer_goto_word_at_cursor(buffer); + buffer_goto_word_at_cursor(buffer, GOTO_DEFINITION); + } + } break; + case CMD_GOTO_DECLARATION_AT_CURSOR: { + if (buffer && buffer_is_named_file(buffer)) { + buffer_goto_word_at_cursor(buffer, GOTO_DECLARATION); } } break; case CMD_FIND_USAGES: -- cgit v1.2.3