1#![cfg_attr(docsrs, feature(doc_cfg))]
15
16mod autocmd;
17mod buffer;
18mod command;
19mod deprecated;
20mod error;
21mod extmark;
22mod ffi;
23mod options;
24pub mod opts;
25pub(crate) mod serde_utils;
26mod tabpage;
27mod trait_utils;
28pub mod types;
29pub(crate) mod utils;
30mod vim;
31mod vimscript;
32mod win_config;
33mod window;
34
35pub use autocmd::*;
36pub use buffer::*;
37pub use command::*;
38pub use deprecated::*;
39pub use error::Error;
40use error::Result;
41pub use extmark::*;
42pub use luajit::IntoResult;
43pub use options::*;
44pub use tabpage::*;
45pub use trait_utils::*;
46pub use vim::*;
47pub use vimscript::*;
48pub use win_config::*;
49pub use window::*;
50
51const INTERNAL_CALL_MASK: u64 = 1u64 << (std::mem::size_of::<u64>() * 8 - 1);
53
54const VIML_INTERNAL_CALL: u64 = INTERNAL_CALL_MASK;
56
57const LUA_INTERNAL_CALL: u64 = VIML_INTERNAL_CALL + 1;
59
60macro_rules! choose {
61 ($err:expr, ()) => {
62 if $err.is_err() {
63 Err($err.into())
64 } else {
65 Ok(())
66 }
67 };
68
69 ($err:expr, $other:expr) => {
70 if $err.is_err() {
71 Err($err.into())
72 } else {
73 $other
74 }
75 };
76}
77
78pub(crate) use choose;