aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorPascal Kuthe2023-11-19 21:34:03 +0000
committerBlaž Hrastnik2024-03-23 06:35:25 +0000
commit69e07ab61e51598ba6e31bdd79608091fdbba254 (patch)
tree896d9d861dcb7875adbd6afe3c446f036ed078b3 /helix-term
parent68b21578ac4b5ded1a262469c6887794a689284f (diff)
use slices instead of Rc for virtual text
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs4
-rw-r--r--helix-term/src/commands/lsp.rs10
2 files changed, 8 insertions, 6 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index ff72cee1..6de05651 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -617,6 +617,7 @@ fn move_impl(cx: &mut Context, move_fn: MoveFn, dir: Direction, behaviour: Movem
&mut annotations,
)
});
+ drop(annotations);
doc.set_selection(view.id, selection);
}
@@ -1637,7 +1638,7 @@ pub fn scroll(cx: &mut Context, offset: usize, direction: Direction, sync_cursor
let doc_text = doc.text().slice(..);
let viewport = view.inner_area(doc);
let text_fmt = doc.text_format(viewport.width, None);
- let mut annotations = view.text_annotations(doc, None);
+ let mut annotations = view.text_annotations(&*doc, None);
(view.offset.anchor, view.offset.vertical_offset) = char_idx_at_visual_offset(
doc_text,
view.offset.anchor,
@@ -1715,6 +1716,7 @@ pub fn scroll(cx: &mut Context, offset: usize, direction: Direction, sync_cursor
let mut sel = doc.selection(view.id).clone();
let idx = sel.primary_index();
sel = sel.replace(idx, prim_sel);
+ drop(annotations);
doc.set_selection(view.id, sel);
}
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index a3168dc2..63d1608f 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -1315,11 +1315,11 @@ fn compute_inlay_hints_for_view(
view_id,
DocumentInlayHints {
id: new_doc_inlay_hints_id,
- type_inlay_hints: type_inlay_hints.into(),
- parameter_inlay_hints: parameter_inlay_hints.into(),
- other_inlay_hints: other_inlay_hints.into(),
- padding_before_inlay_hints: padding_before_inlay_hints.into(),
- padding_after_inlay_hints: padding_after_inlay_hints.into(),
+ type_inlay_hints,
+ parameter_inlay_hints,
+ other_inlay_hints,
+ padding_before_inlay_hints,
+ padding_after_inlay_hints,
},
);
doc.inlay_hints_oudated = false;