summaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
authorBenoƮt CORTIER2021-06-15 03:26:05 +0000
committerIvan Tham2021-06-15 15:01:56 +0000
commit6bdf609caaf4eb1c137f503f147d1e4e4f3e8676 (patch)
tree6de0864a077dd6bdea6f956ece264542a3ebeee7 /helix-term/src/ui/editor.rs
parent6fb2d2679dc63ca34be0d02efb543c3e0b49cb74 (diff)
Remove RwLock for registers
Registers are stored inside `Editor` and accessed without `RwLock`. To work around ownership, I added a sister method to `Editor::current`: `Editor::current_with_context`. I tried to modify `Editor::current` directly but it's used at a lot of places so I reverted into this for now at least.
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 4b4b9fb2..5913df29 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -570,7 +570,7 @@ impl EditorView {
// debug_assert!(cxt.count != 0);
// set the register
- cxt.register = cxt.editor.register.take();
+ cxt.selected_register = cxt.editor.selected_register.take();
if let Some(command) = self.keymap[&mode].get(&event) {
command(cxt);
@@ -610,7 +610,7 @@ impl Component for EditorView {
let mode = doc.mode();
let mut cxt = commands::Context {
- register: helix_view::RegisterSelection::default(),
+ selected_register: helix_view::RegisterSelection::default(),
editor: &mut cx.editor,
count: None,
callback: None,