diff options
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/flat_tree.rs | 9 |
4 files changed, 13 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b22ec62..41b9d5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ -### Master +<a name="v0.10.3"></a> +### v0.10.3 - 2019-11-27 +* fix crash on doing `:rm` on the last child of current root * refactor help page generation using Termimad templates -* clear help background when terminal was resized +* clear help background when terminal was resized between redraws <a name="v0.10.2"></a> ### v0.10.2 - 2019-11-15 @@ -88,7 +88,7 @@ dependencies = [ [[package]] name = "broot" -version = "0.10.2" +version = "0.10.3" dependencies = [ "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1,6 +1,6 @@ [package] name = "broot" -version = "0.10.2" +version = "0.10.3" authors = ["dystroy <denys.seguret@gmail.com>"] repository = "https://github.com/Canop/broot" documentation = "https://dystroy.org/broot" diff --git a/src/flat_tree.rs b/src/flat_tree.rs index d3a209c..8118821 100644 --- a/src/flat_tree.rs +++ b/src/flat_tree.rs @@ -163,12 +163,17 @@ impl PartialOrd for TreeLine { impl Tree { pub fn refresh(&mut self, page_height: usize) -> Result<(), errors::TreeBuildError> { - let builder = - TreeBuilder::from(self.root().to_path_buf(), self.options.clone(), page_height)?; + let builder = TreeBuilder::from( + self.root().to_path_buf(), + self.options.clone(), + page_height, + )?; let mut tree = builder.build(&TaskLifetime::unlimited()).unwrap(); // should not fail // we save the old selection to try restore it let selected_path = self.selected_line().path.to_path_buf(); mem::swap(&mut self.lines, &mut tree.lines); + self.selection = 0; // so that there's no error if we can't find the selection after refresh + self.scroll = 0; self.try_select_path(&selected_path); self.make_selection_visible(page_height as i32); Ok(()) |