2020-06-02 09:57:01 +08:00
|
|
|
#![allow(unused)]
|
2021-02-18 17:35:39 +08:00
|
|
|
pub mod comment;
|
2020-10-20 12:58:34 +08:00
|
|
|
mod diagnostic;
|
2020-09-10 12:55:18 +08:00
|
|
|
pub mod graphemes;
|
2020-10-04 16:15:43 +08:00
|
|
|
mod history;
|
2020-10-14 11:01:41 +08:00
|
|
|
pub mod indent;
|
2020-09-21 17:24:16 +08:00
|
|
|
pub mod macros;
|
2021-02-22 14:50:41 +08:00
|
|
|
pub mod object;
|
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;
|
2020-06-25 02:59:35 +08:00
|
|
|
pub mod state;
|
2020-09-12 18:36:49 +08:00
|
|
|
pub mod syntax;
|
2020-05-25 12:02:21 +08:00
|
|
|
mod transaction;
|
2020-05-20 17:14:51 +08:00
|
|
|
|
2021-02-18 17:34:22 +08:00
|
|
|
pub(crate) fn find_first_non_whitespace_char2(line: RopeSlice) -> Option<usize> {
|
|
|
|
// find first non-whitespace char
|
2021-02-18 17:45:41 +08:00
|
|
|
for (start, ch) in line.chars().enumerate() {
|
2021-02-18 17:34:22 +08:00
|
|
|
// TODO: could use memchr with chunks?
|
|
|
|
if ch != ' ' && ch != '\t' && ch != '\n' {
|
|
|
|
return Some(start);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
None
|
|
|
|
}
|
|
|
|
pub(crate) fn find_first_non_whitespace_char(text: RopeSlice, line_num: usize) -> Option<usize> {
|
|
|
|
let line = text.line(line_num);
|
|
|
|
let mut start = text.line_to_char(line_num);
|
|
|
|
|
|
|
|
// find first non-whitespace char
|
|
|
|
for ch in line.chars() {
|
|
|
|
// TODO: could use memchr with chunks?
|
|
|
|
if ch != ' ' && ch != '\t' && ch != '\n' {
|
|
|
|
return Some(start);
|
|
|
|
}
|
|
|
|
start += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
2020-06-05 13:02:10 +08:00
|
|
|
pub use ropey::{Rope, RopeSlice};
|
2020-09-29 00:00:35 +08:00
|
|
|
|
2020-05-28 13:45:44 +08:00
|
|
|
pub use tendril::StrTendril as Tendril;
|
|
|
|
|
2020-09-29 00:01:27 +08:00
|
|
|
#[doc(inline)]
|
|
|
|
pub use {regex, tree_sitter};
|
|
|
|
|
2020-09-17 13:57:49 +08:00
|
|
|
pub use position::Position;
|
2020-09-19 22:16:00 +08:00
|
|
|
pub use selection::Range;
|
2020-05-25 12:02:21 +08:00
|
|
|
pub use selection::Selection;
|
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-10-04 16:15:43 +08:00
|
|
|
pub use history::History;
|
2020-05-25 12:02:21 +08:00
|
|
|
pub use state::State;
|
|
|
|
|
2020-10-23 17:48:03 +08:00
|
|
|
pub use transaction::{Assoc, Change, ChangeSet, Operation, Transaction};
|