1pub use encoding_rs as encoding;
16pub mod match_brackets;
28pub mod text_annotations;
34 pub use unicode_general_category as category;
35 pub use unicode_segmentation as segmentation;
36 pub use unicode_width as width;
39pub fn find_first_non_whitespace_char(line: RopeSlice) -> Option<usize> {
40 line.chars().position(|ch| !ch.is_whitespace())
45/// Order of detection:
46/// * Top-most folder containing a root marker in current git repository
47/// * Git repository root if no marker detected
48/// * Top-most folder containing a root marker if not git repository detected
49/// * Current working directory as fallback
50pub fn find_root(root: Option<&str>, root_markers: &[String]) -> std::path::PathBuf {
51 let current_dir = std::env::current_dir().expect("unable to determine current directory");
53 let root = match root {
55 let root = std::path::Path::new(root);
56 if root.is_absolute() {
59 current_dir.join(root)
62 None => current_dir.clone(),
65 let mut top_marker = None;
66 for ancestor in root.ancestors() {
69 .any(|marker| ancestor.join(marker).exists())
71 top_marker = Some(ancestor);
74 if ancestor.join(".git").exists() {
75 // Top marker is repo root if not root marker was detected yet
76 if top_marker.is_none() {
77 top_marker = Some(ancestor);
79 // Don't go higher than repo if we're in one
84 // Return the found top marker or the current_dir as fallback
85 top_marker.map_or(current_dir, |a| a.to_path_buf())
88pub use ropey::{self, str_utils, Rope, RopeBuilder, RopeSlice};
90// pub use tendril::StrTendril as Tendril;
91pub use smartstring::SmartString;
93pub type Tendril = SmartString<smartstring::LazyCompact>;
96pub use {regex, tree_sitter};
98pub use graphemes::RopeGraphemes;
100 char_idx_at_visual_offset, coords_at_pos, pos_at_coords, visual_offset_from_anchor,
101 visual_offset_from_block, Position,
104pub use position::{pos_at_visual_coords, visual_coords_at_pos};
106pub use selection::{Range, Selection};
107pub use smallvec::{smallvec, SmallVec};
108pub use syntax::Syntax;
110pub use diagnostic::Diagnostic;
112pub use line_ending::{LineEnding, DEFAULT_LINE_ENDING};
113pub use transaction::{Assoc, Change, ChangeSet, Operation, Transaction};
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list