aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
authorBenoît CORTIER2021-06-17 22:09:10 +0000
committerBlaž Hrastnik2021-06-18 00:38:10 +0000
commit8664d70e731c73fa34dda293b4f6b6dec80a3273 (patch)
tree3535c4376533fb19323afc60a8d6d223326ace77 /helix-term/src/ui/editor.rs
parentf65db9397a2d832f7ef873ea416f13f8fb07cb74 (diff)
Replace `Editor::current` by a macro
This is necessary to workaround ownership issues across function calls. The issue notably arised when implementing the registers into `Editor` and I was getting annoyed again when implementing copy/pasting into system clipboard. The problem is addressed by using macro calls instead of function calls. There is no notable side effect.
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 07107c9e..ba5e7574 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -615,7 +615,7 @@ impl Component for EditorView {
// clear status
cx.editor.status_msg = None;
- let (view, doc) = cx.editor.current();
+ let (view, doc) = current!(cx.editor);
let mode = doc.mode();
let mut cxt = commands::Context {
@@ -684,7 +684,7 @@ impl Component for EditorView {
return EventResult::Ignored;
}
- let (view, doc) = cx.editor.current();
+ let (view, doc) = current!(cx.editor);
view.ensure_cursor_in_view(doc);
// mode transitions