From 3a1af93e9c0f983da64070d3774596844c2a26e1 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 30 Sep 2025 10:42:13 -0400 Subject: Initial implementation of code actions --- buffer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index 9b8a79d..11b239d 100644 --- a/buffer.c +++ b/buffer.c @@ -2660,6 +2660,9 @@ void buffer_delete_chars_at_pos(TextBuffer *buffer, BufferPos pos, i64 nchars_) // just in case buffer_pos_validate(buffer, &buffer->cursor_pos); buffer_pos_validate(buffer, &buffer->selection_pos); + if (buffer_pos_eq(buffer->cursor_pos, buffer->selection_pos)) { + buffer->selection = false; + } // we need to do this *after* making the change to the buffer // because of how non-incremental syncing works. @@ -3529,6 +3532,8 @@ bool buffer_handle_click(Ted *ted, TextBuffer *buffer, vec2 click, u8 times) { else autocomplete_close(ted); // close autocomplete menu if user clicks outside of it } + if (code_action_is_open(ted)) + return false; if (buffer_pixels_to_pos(buffer, click, &buffer_pos)) { // user clicked on buffer if (!menu_is_any_open(ted) || buffer->is_line_buffer) { -- cgit v1.2.3