diff options
-rw-r--r-- | ide-autocomplete.c | 2 | ||||
-rw-r--r-- | main.c | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/ide-autocomplete.c b/ide-autocomplete.c index 3ff138e..b469051 100644 --- a/ide-autocomplete.c +++ b/ide-autocomplete.c @@ -107,6 +107,7 @@ static bool autocomplete_should_display_phantom(Ted *ted) { // do the actual completion static void autocomplete_complete(Ted *ted, Autocompletion completion) { TextBuffer *buffer = ted->active_buffer; + if (buffer_has_selection(buffer)) return; buffer_start_edit_chain(buffer); // don't merge with other edits if (is32_word(buffer_char_before_cursor(buffer))) buffer_backspace_words_at_cursor(buffer, 1); // delete whatever text was already typed @@ -463,6 +464,7 @@ void autocomplete_open(Ted *ted, uint32_t trigger) { if (!buffer) return; if (!buffer_is_named_file(buffer)) return; if (buffer_is_view_only(buffer)) return; + if (buffer_has_selection(buffer)) return; autocomplete_clear_phantom(ac); const Settings *settings = buffer_settings(buffer); bool regenerated = false; @@ -1,6 +1,5 @@ /* TODO: -- don't autocomplete when tab is pressed if there is text selected - highlight <https://example.org> correctly in Markdown - highlight (https://example.org) correctly in Markdown (exactly which characters are allowed in links?) - what did I mean by this |