From 83dcd204e2f4db08ab5f52ca50a9bc3213c1f6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denys=20S=C3=A9guret?= Date: Sat, 15 Jun 2019 09:27:56 +0200 Subject: fix blank help screen on scroll when it fits the screen --- CHANGELOG.md | 4 ++++ Cargo.lock | 8 ++++---- Cargo.toml | 11 +++++------ src/git_ignore.rs | 2 +- src/help_states.rs | 9 ++------- src/screens.rs | 2 +- src/verbs.rs | 2 +- 7 files changed, 18 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5464e8b..e4e3c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ + +### v0.8.2 - 2019-06-15 +- fix wrong result of scrolling when help text fits the screen + ### v0.8.1 - 2019-06-10 - change default skin to only use highly compatible colors diff --git a/Cargo.lock b/Cargo.lock index 4022a53..94f997d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,7 +86,7 @@ dependencies = [ [[package]] name = "broot" -version = "0.8.1" +version = "0.8.2" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -100,7 +100,7 @@ dependencies = [ "opener 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "termimad 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "termimad 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -617,7 +617,7 @@ dependencies = [ [[package]] name = "termimad" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossterm 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -795,7 +795,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)" = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" -"checksum termimad 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c335380ef344bd1d9f20866ea45ba96319ef3191a43d38210c12a565a547848" +"checksum termimad 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "588f504dbca71edfb07f0e6e021b9e5a0b6c9e19854f921e5a9fef7bbb6a9370" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" diff --git a/Cargo.toml b/Cargo.toml index c272ce5..b439b0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "broot" -version = "0.8.1" +version = "0.8.2" authors = ["dystroy "] repository = "https://github.com/Canop/broot" description = "Fuzzy Search + tree + cd" @@ -11,24 +11,23 @@ categories = ["command-line-utilities"] readme = "README.md" [dependencies] -regex = "1" +regex = "1.1" lazy_static = "1.3" directories = "2.0" toml = "0.5" custom_error = "1.6" log = "0.4" simplelog = "0.5" -clap = "2.32" +clap = "2.33" glob = "0.3" crossbeam = "0.7" opener = "0.4" crossterm = "0.9.5" -termimad = "0.3.5" +termimad = "0.3.6" #termimad = { path = "../termimad" } - +users = "0.9" [target.'cfg(unix)'.dependencies] jemallocator = "0.3" -users = "0.9" [profile.release] lto = true # link time optimization - roughly halves the size of the exec diff --git a/src/git_ignore.rs b/src/git_ignore.rs index c569bad..d0f1b6d 100644 --- a/src/git_ignore.rs +++ b/src/git_ignore.rs @@ -102,7 +102,7 @@ impl GitIgnoreFilter { filter.files.push(gif); } Err(e) => { - info!("reading GIF failed: {:?}", e); + info!("reading git ignore file failed: {:?}", e); } } } diff --git a/src/help_states.rs b/src/help_states.rs index 22a31b5..92c356f 100644 --- a/src/help_states.rs +++ b/src/help_states.rs @@ -20,9 +20,7 @@ pub struct HelpState { impl HelpState { pub fn new(screen: &Screen, con: &AppContext) -> HelpState { - let mut area = Area::uninitialized(); - area.top = 0; - area.left = 0; + let area = Area::uninitialized(); // will be fixed at drawing time let markdown = help_content::build_markdown(con); let view = MadView::from(markdown, area, screen.skin.to_mad_skin()); HelpState { view } @@ -78,13 +76,10 @@ impl AppState for HelpState { fn display(&mut self, screen: &mut Screen, _con: &AppContext) -> io::Result<()> { self.resize_area(screen); - let r = self.view.write(); - debug!("r={:?}", r); - Ok(()) + self.view.write() } fn write_status(&self, screen: &mut Screen, cmd: &Command, con: &AppContext) -> io::Result<()> { - debug!("help write_status"); match &cmd.action { Action::VerbEdit(invocation) => match con.verb_store.search(&invocation.key) { PrefixSearchResult::NoMatch => screen.write_status_err("No matching verb)"), diff --git a/src/screens.rs b/src/screens.rs index 1573d30..00957bf 100644 --- a/src/screens.rs +++ b/src/screens.rs @@ -24,7 +24,7 @@ impl Screen { skin, }; screen.read_size(con)?; - info!("screen size: {} x {}", screen.w, screen.h); + debug!("screen size: {} x {}", screen.w, screen.h); let cursor = TerminalCursor::new(); cursor.hide().unwrap(); Ok(screen) diff --git a/src/verbs.rs b/src/verbs.rs index 6fd2e89..297bf66 100644 --- a/src/verbs.rs +++ b/src/verbs.rs @@ -267,7 +267,7 @@ impl Verb { let execution = launchable.execute(); match execution { Ok(()) => { - info!("ok"); + debug!("ok"); AppStateCmdResult::RefreshState } Err(e) => { -- cgit v1.2.3