aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-27 01:44:12 +0000
committerBlaž Hrastnik2021-10-05 13:27:35 +0000
commit66f26e82ceaf4b81dfeb429dcb840a3242e8f254 (patch)
treed2346e40e8e1b63c00ea3b2007e2085372f12658 /helix-view/src
parent40abec80e1062503d70055ed9e968cd4b31411a7 (diff)
Filter the initial completion
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/macros.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/helix-view/src/macros.rs b/helix-view/src/macros.rs
index c9a04270..0bebd02f 100644
--- a/helix-view/src/macros.rs
+++ b/helix-view/src/macros.rs
@@ -44,3 +44,19 @@ macro_rules! view {
$( $editor ).+ .tree.get($( $editor ).+ .tree.focus)
}};
}
+
+#[macro_export]
+macro_rules! doc {
+ ( $( $editor:ident ).+ ) => {{
+ $crate::current_ref!( $( $editor ).+ ).1
+ }};
+}
+
+#[macro_export]
+macro_rules! current_ref {
+ ( $( $editor:ident ).+ ) => {{
+ let view = $( $editor ).+ .tree.get($( $editor ).+ .tree.focus);
+ let doc = &$( $editor ).+ .documents[view.doc];
+ (view, doc)
+ }};
+}