From c8e5c3963b89187ff2997395bad60f6dba5e7b10 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 26 Aug 2023 09:51:47 +0200 Subject: [PATCH] Clear selection when deploying inline assistant --- crates/ai/src/assistant.rs | 3 +++ todo.md | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/ai/src/assistant.rs b/crates/ai/src/assistant.rs index 65b255d458..b99d4b4fac 100644 --- a/crates/ai/src/assistant.rs +++ b/crates/ai/src/assistant.rs @@ -276,6 +276,9 @@ impl AssistantPanel { assistant }); let block_id = editor.update(cx, |editor, cx| { + editor.change_selections(None, cx, |selections| { + selections.select_anchor_ranges([selection.head()..selection.head()]) + }); editor.highlight_background::( vec![range.clone()], |theme| theme.assistant.inline.pending_edit_background, diff --git a/todo.md b/todo.md index 8a9a8b5b3d..71ca5a7c7b 100644 --- a/todo.md +++ b/todo.md @@ -14,12 +14,8 @@ - [ ] Selection is cleared and cursor is moved to prompt input - [ ] Ability to highlight background multiple times for the same type - [x] Basic Styling -- [ ] Match lowest indentation level of selected lines when inserting an inline assist - [ ] Look into why insert prompts have a weird indentation sometimes - - - - Multicursor - Run the same prompt for every selection in parallel - Position the prompt editor at the newest cursor