diff options
author | pommicket <pommicket@gmail.com> | 2025-09-30 10:42:13 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-30 10:42:13 -0400 |
commit | 3a1af93e9c0f983da64070d3774596844c2a26e1 (patch) | |
tree | 65878feb922fcec4ae9f3cae4bbc1a5ee99d6cb9 /buffer.c | |
parent | 84da626a18ccc779aef4a178ee0097a93c959520 (diff) |
Initial implementation of code actions
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) { |