2021-12-25 23:10:46 +08:00
|
|
|
pub use encoding_rs as encoding;
|
|
|
|
|
2021-03-22 11:18:48 +08:00
|
|
|
pub mod auto_pairs;
|
2021-06-14 10:13:31 +08:00
|
|
|
pub mod chars;
|
2021-02-18 17:35:39 +08:00
|
|
|
pub mod comment;
|
2022-02-15 00:41:53 +08:00
|
|
|
pub mod config;
|
2021-03-11 15:31:49 +08:00
|
|
|
pub mod diagnostic;
|
2021-07-02 22:54:50 +08:00
|
|
|
pub mod diff;
|
2020-09-10 12:55:18 +08:00
|
|
|
pub mod graphemes;
|
2021-06-11 21:06:13 +08:00
|
|
|
pub mod history;
|
2021-11-22 01:38:41 +08:00
|
|
|
pub mod increment;
|
2020-10-14 11:01:41 +08:00
|
|
|
pub mod indent;
|
2021-06-16 23:05:14 +08:00
|
|
|
pub mod line_ending;
|
2020-09-21 17:24:16 +08:00
|
|
|
pub mod macros;
|
2021-03-22 16:58:49 +08:00
|
|
|
pub mod match_brackets;
|
2021-03-18 12:39:34 +08:00
|
|
|
pub mod movement;
|
2021-02-22 14:50:41 +08:00
|
|
|
pub mod object;
|
2021-08-25 09:04:05 +08:00
|
|
|
pub mod path;
|
2020-09-17 13:57:49 +08:00
|
|
|
mod position;
|
2020-10-06 15:00:23 +08:00
|
|
|
pub mod register;
|
2021-03-11 09:44:38 +08:00
|
|
|
pub mod search;
|
2020-09-29 00:01:27 +08:00
|
|
|
pub mod selection;
|
2021-12-12 20:13:33 +08:00
|
|
|
pub mod shellwords;
|
2021-05-30 16:52:46 +08:00
|
|
|
mod state;
|
2021-06-20 01:25:50 +08:00
|
|
|
pub mod surround;
|
2020-09-12 18:36:49 +08:00
|
|
|
pub mod syntax;
|
2022-02-07 23:37:09 +08:00
|
|
|
pub mod test;
|
2021-07-03 09:07:49 +08:00
|
|
|
pub mod textobject;
|
2020-05-25 12:02:21 +08:00
|
|
|
mod transaction;
|
2022-05-02 22:24:22 +08:00
|
|
|
pub mod wrap;
|
2020-05-20 17:14:51 +08:00
|
|
|
|
2021-06-18 16:47:10 +08:00
|
|
|
pub mod unicode {
|
|
|
|
pub use unicode_general_category as category;
|
|
|
|
pub use unicode_segmentation as segmentation;
|
|
|
|
pub use unicode_width as width;
|
|
|
|
}
|
|
|
|
|
2021-06-08 15:11:45 +08:00
|
|
|
pub fn find_first_non_whitespace_char(line: RopeSlice) -> Option<usize> {
|
2021-06-08 14:25:55 +08:00
|
|
|
line.chars().position(|ch| !ch.is_whitespace())
|
2021-02-18 17:34:22 +08:00
|
|
|
}
|
|
|
|
|
2021-12-31 16:06:54 +08:00
|
|
|
/// Find project root.
|
|
|
|
///
|
|
|
|
/// Order of detection:
|
|
|
|
/// * Top-most folder containing a root marker in current git repository
|
2022-06-02 01:01:37 +08:00
|
|
|
/// * Git repository root if no marker detected
|
2021-12-31 16:06:54 +08:00
|
|
|
/// * Top-most folder containing a root marker if not git repository detected
|
|
|
|
/// * Current working directory as fallback
|
|
|
|
pub fn find_root(root: Option<&str>, root_markers: &[String]) -> Option<std::path::PathBuf> {
|
2022-04-18 11:10:51 +08:00
|
|
|
helix_loader::find_root_impl(root, root_markers)
|
|
|
|
.first()
|
|
|
|
.cloned()
|
2021-06-07 20:32:01 +08:00
|
|
|
}
|
|
|
|
|
2022-05-30 11:29:07 +08:00
|
|
|
pub use ropey::{str_utils, Rope, RopeBuilder, RopeSlice};
|
2020-09-29 00:00:35 +08:00
|
|
|
|
2022-02-07 13:03:04 +08:00
|
|
|
// pub use tendril::StrTendril as Tendril;
|
|
|
|
pub use smartstring::SmartString;
|
|
|
|
|
|
|
|
pub type Tendril = SmartString<smartstring::LazyCompact>;
|
2020-05-28 13:45:44 +08:00
|
|
|
|
2020-09-29 00:01:27 +08:00
|
|
|
#[doc(inline)]
|
|
|
|
pub use {regex, tree_sitter};
|
|
|
|
|
2021-06-12 05:57:16 +08:00
|
|
|
pub use graphemes::RopeGraphemes;
|
2021-11-03 11:02:29 +08:00
|
|
|
pub use position::{coords_at_pos, pos_at_coords, visual_coords_at_pos, Position};
|
2021-03-22 11:40:07 +08:00
|
|
|
pub use selection::{Range, Selection};
|
2021-08-29 22:02:46 +08:00
|
|
|
pub use smallvec::{smallvec, SmallVec};
|
2020-09-17 13:57:49 +08:00
|
|
|
pub use syntax::Syntax;
|
2020-05-25 12:02:21 +08:00
|
|
|
|
2020-10-20 12:58:34 +08:00
|
|
|
pub use diagnostic::Diagnostic;
|
2020-05-25 12:02:21 +08:00
|
|
|
pub use state::State;
|
|
|
|
|
2021-06-22 01:29:29 +08:00
|
|
|
pub use line_ending::{LineEnding, DEFAULT_LINE_ENDING};
|
2020-10-23 17:48:03 +08:00
|
|
|
pub use transaction::{Assoc, Change, ChangeSet, Operation, Transaction};
|