aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorAndrii Grynenko2023-02-17 15:51:00 +0000
committerBlaž Hrastnik2023-03-08 01:48:35 +0000
commit1866b43cd355ff6d41d579b4b710a0f602aa79d1 (patch)
tree8550d0bc46df11e0a28c301becf75642ac70317d /helix-term
parentec6e575a408372400b7789b90cdf6ac271f51182 (diff)
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.
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/completion.rs8
1 files changed, 4 insertions, 4 deletions
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!(