summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-30 10:42:13 -0400
committerpommicket <pommicket@gmail.com>2025-09-30 10:42:13 -0400
commit3a1af93e9c0f983da64070d3774596844c2a26e1 (patch)
tree65878feb922fcec4ae9f3cae4bbc1a5ee99d6cb9 /buffer.c
parent84da626a18ccc779aef4a178ee0097a93c959520 (diff)
Initial implementation of code actions
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c5
1 files changed, 5 insertions, 0 deletions
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) {