on 2158366 help sign in
helix/helix-view/src/macros.rs
29 lines 644 B history raw
1#[macro_export]
2macro_rules! current {
3 ( $( $editor:ident ).+ ) => {{
4 let view = $crate::view_mut!( $( $editor ).+ );
5 let doc = &mut $( $editor ).+ .documents[view.doc];
6 (view, doc)
7 }};
8}
10#[macro_export]
11macro_rules! doc_mut {
12 ( $( $editor:ident ).+ ) => {{
13 $crate::current!( $( $editor ).+ ).1
14 }};
17#[macro_export]
18macro_rules! view_mut {
19 ( $( $editor:ident ).+ ) => {{
20 $( $editor ).+ .tree.get_mut($( $editor ).+ .tree.focus)
21 }};
24#[macro_export]
25macro_rules! view {
26 ( $( $editor:ident ).+ ) => {{
27 $( $editor ).+ .tree.get($( $editor ).+ .tree.focus)
28 }};