From 1866b43cd355ff6d41d579b4b710a0f602aa79d1 Mon Sep 17 00:00:00 2001 From: Andrii Grynenko Date: Fri, 17 Feb 2023 07:51:00 -0800 Subject: Render every LSP snippets for every cursor This refactors the snippet logic to be largely unaware of the rest of the document. The completion application logic is moved into generate_transaction_from_snippet which is extended to support dynamically computing replacement text. --- helix-term/src/ui/completion.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'helix-term') diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index c7955a3d..e7815e12 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -138,14 +138,14 @@ impl Completion { ) { match snippet::parse(&edit.new_text) { - Ok(snippet) => snippet::into_transaction( - snippet, + Ok(snippet) => util::generate_transaction_from_snippet( doc.text(), doc.selection(view_id), - &edit, + &edit.range, + snippet, doc.line_ending.as_str(), - offset_encoding, include_placeholder, + offset_encoding, ), Err(err) => { log::error!( -- cgit v1.2.3-70-g09d2