summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-03 18:01:04 -0500
committerpommicket <pommicket@gmail.com>2023-01-03 18:01:04 -0500
commitc0397f1f4c80e73a2e4ccd1946703fe6a5bb405e (patch)
tree5b95649c140083e2af4332bb92260842436f22c9 /buffer.c
parent87c8bd6eb27edb4bfc539967235c3a1e2f8d77e4 (diff)
go to type definition
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index 4645f75..0d372fc 100644
--- a/buffer.c
+++ b/buffer.c
@@ -2561,14 +2561,17 @@ bool buffer_handle_click(Ted *ted, TextBuffer *buffer, vec2 click, u8 times) {
// select to position
buffer_select_to_pos(buffer, buffer_pos);
break;
- case KEY_MODIFIER_CTRL:
+ case KEY_MODIFIER_CTRL:
case KEY_MODIFIER_CTRL | KEY_MODIFIER_SHIFT:
+ case KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT:
if (!buffer->is_line_buffer) {
// go to definition/declaration
buffer_cursor_move_to_pos(buffer, buffer_pos);
GotoType type = GOTO_DEFINITION;
if (ted->key_modifier & KEY_MODIFIER_SHIFT)
type = GOTO_DECLARATION;
+ else if (ted->key_modifier & KEY_MODIFIER_ALT)
+ type = GOTO_TYPE_DEFINITION;
buffer_goto_word_at_cursor(buffer, type);
}
break;