summaryrefslogtreecommitdiffstats
path: root/src/tree
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-06-07 15:41:20 +0200
committerCanop <cano.petrole@gmail.com>2022-06-07 15:41:20 +0200
commitdcdf9d67b3267a2a3f8a92be8374cffbae6e23fb (patch)
tree52b5b28a2862e954359932a69bd9808c03f85f76 /src/tree
parent0ae860274c57f7dbabc68d30dcf534bb062a68f9 (diff)
hint on empty tree: use alt-i or alt-h
Fix #556
Diffstat (limited to 'src/tree')
-rw-r--r--src/tree/tree.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tree/tree.rs b/src/tree/tree.rs
index ac32d9e..625ce16 100644
--- a/src/tree/tree.rs
+++ b/src/tree/tree.rs
@@ -7,7 +7,7 @@ use {
git::TreeGitStatus,
task_sync::ComputationResult,
task_sync::Dam,
- tree_build::{BId, TreeBuilder},
+ tree_build::{BId, BuildReport, TreeBuilder},
},
fnv::FnvHashMap,
std::{
@@ -27,9 +27,9 @@ pub struct Tree {
pub selection: usize, // there's always a selection (starts with root, which is 0)
pub options: TreeOptions,
pub scroll: usize, // the number of lines at the top hidden because of scrolling
- pub nb_gitignored: u32, // number of times a gitignore pattern excluded a file
pub total_search: bool, // whether the search was made on all children
pub git_status: ComputationResult<TreeGitStatus>,
+ pub build_report: BuildReport,
}
impl Tree {
@@ -70,7 +70,6 @@ impl Tree {
/// - compute left branchs
pub fn after_lines_changed(&mut self) {
-
// we need to order the lines to build the tree.
// It's a little complicated because
// - we want a case insensitive sort
@@ -190,6 +189,10 @@ impl Tree {
}
}
+ pub fn is_empty(&self) -> bool {
+ self.lines.len() == 1
+ }
+
pub fn has_branch(&self, line_index: usize, depth: usize) -> bool {
if line_index >= self.lines.len() {
return false;