diff options
Diffstat (limited to 'helix-core/src/lib.rs')
-rw-r--r-- | helix-core/src/lib.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index da48ba7e..f5e7de52 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -18,24 +18,9 @@ pub mod syntax; mod transaction; pub mod words; -pub fn find_first_non_whitespace_char2(line: RopeSlice) -> Option<usize> { +pub fn find_first_non_whitespace_char(line: RopeSlice) -> Option<usize> { line.chars().position(|ch| !ch.is_whitespace()) } -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 -} pub fn find_root(root: Option<&str>) -> Option<std::path::PathBuf> { let current_dir = std::env::current_dir().expect("unable to determine current directory"); |