From ba24cfe9125eda97346e3ceee42686fb9f46046f Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sat, 11 Feb 2023 14:20:49 +0100 Subject: Delete snippet placeholders when accepting completion When accepting a snippet completion we automatically delete the placeholders for now as doing so manual is quite cumbersome. In the future we should keep these as a mark + virtual text that is automatically removed once the cursor moves there. --- helix-term/src/ui/completion.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'helix-term/src/ui/completion.rs') diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index 6897305d..c7955a3d 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -118,6 +118,7 @@ impl Completion { offset_encoding: helix_lsp::OffsetEncoding, start_offset: usize, trigger_offset: usize, + include_placeholder: bool, ) -> Transaction { use helix_lsp::snippet; @@ -144,6 +145,7 @@ impl Completion { &edit, doc.line_ending.as_str(), offset_encoding, + include_placeholder, ), Err(err) => { log::error!( @@ -216,6 +218,7 @@ impl Completion { offset_encoding, start_offset, trigger_offset, + true, ); // initialize a savepoint @@ -238,6 +241,7 @@ impl Completion { offset_encoding, start_offset, trigger_offset, + false, ); doc.apply(&transaction, view.id); -- cgit v1.2.3-70-g09d2