diff options
author | Canop <cano.petrole@gmail.com> | 2019-12-16 20:24:44 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2019-12-16 20:29:30 +0100 |
commit | 0bad8053a2fdad444cbd3ba77fcc5c7d391e46ef (patch) | |
tree | 65b60432bb0844be70a3e5b013a9e865de987f30 | |
parent | d327ae6cb0fd00b66f4ca33664b904684269e9e0 (diff) |
fix a compilation problem on windowsv0.10.4
-rw-r--r-- | CHANGELOG.md | 7 | ||||
-rw-r--r-- | Cargo.lock | 8 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | src/app.rs | 14 | ||||
-rw-r--r-- | src/displayable_tree.rs | 10 | ||||
-rw-r--r-- | src/help_states.rs | 49 | ||||
-rw-r--r-- | src/screens.rs | 38 |
7 files changed, 67 insertions, 63 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e70e143..723bc03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ -### master +<a name="v0.10.4"></a> +### v0.10.4 - 2019-12-16 * fuzzy search performance improvement * verb invocation now optional so that a verb can be defined to just introduce a keyboard shortcut -* changes in br shell function storage and sourcing from fish, bash, and zsh. Fixes #39 and #53. This means broot will ask you again to install the br function * owner and group separately skinned +* screen redrawn on resize (but tree not recomputed, you may want to do F5 to have the best sized tree) +* changes in br shell function storage and sourcing from fish, bash, and zsh. Fixes #39 and #53. +Note that broot will ask you again to install the br function <a name="v0.10.3"></a> ### v0.10.3 - 2019-11-27 @@ -93,7 +93,7 @@ dependencies = [ [[package]] name = "broot" -version = "0.10.3" +version = "0.10.4" 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)", @@ -112,7 +112,7 @@ dependencies = [ "opener 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "simplelog 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", - "termimad 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", + "termimad 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "umask 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -960,7 +960,7 @@ dependencies = [ [[package]] name = "termimad" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1231,7 +1231,7 @@ dependencies = [ "checksum syn 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7bedb3320d0f3035594b0b723c8a28d7d336a3eda3881db79e61d676fb644c" "checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" "checksum term 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5" -"checksum termimad 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc352ddcefd0fe5648c5aa98486fa58e7623c1efb40d12beae7621fd2c99c58" +"checksum termimad 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6a08d0b4d0b9141c57a6a5a8cedaeed668f33bdff2f3cdfb5f35ea694dd5c064" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thiserror 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fe148fa0fc3363a27092d48f7787363ded15bb8623c5d5dd4e2e9f23e4b21bc" "checksum thiserror-impl 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "258da67e99e590650fa541ac6be764313d23e80cefb6846b516deb8de6b6d921" @@ -1,6 +1,6 @@ [package] name = "broot" -version = "0.10.3" +version = "0.10.4" authors = ["dystroy <denys.seguret@gmail.com>"] repository = "https://github.com/Canop/broot" documentation = "https://dystroy.org/broot" @@ -27,7 +27,7 @@ opener = "0.4" crossterm = "0.14.0" umask = "0.1.7" minimad = "0.5.2" -termimad = "0.8.2" +termimad = "0.8.4" id-arena = "2.2.1" lazy-regex = "0.1" @@ -13,8 +13,8 @@ use { crossterm::{ cursor, event::{DisableMouseCapture, EnableMouseCapture}, - queue, terminal::{EnterAlternateScreen, LeaveAlternateScreen}, + QueueableCommand, }, minimad::Composite, termimad::EventSource, @@ -157,9 +157,9 @@ impl App { /// called exactly once at end of `run`, cleans the writer (which /// is usually stdout or stderr) fn end(&mut self, writer: &mut W) ->Result<Option<Launchable>, ProgramError> { - queue!(writer, DisableMouseCapture)?; - queue!(writer, cursor::Show)?; - queue!(writer, LeaveAlternateScreen)?; + writer.queue(DisableMouseCapture)?; + writer.queue(cursor::Show)?; + writer.queue(LeaveAlternateScreen)?; writer.flush()?; debug!("we left the screen"); Ok(self.launch_at_end.take()) @@ -173,14 +173,14 @@ impl App { skin: Skin, ) -> Result<Option<Launchable>, ProgramError> { - queue!(writer, EnterAlternateScreen)?; - queue!(writer, cursor::Hide)?; + writer.queue(EnterAlternateScreen)?; + writer.queue(cursor::Hide)?; debug!("we're on screen"); let mut screen = Screen::new(con, skin)?; // we listen for events in a separate thread so that we can go on listening // when a long search is running, and interrupt it if needed - queue!(writer, EnableMouseCapture)?; + writer.queue(EnableMouseCapture)?; let event_source = EventSource::new()?; let rx_events = event_source.receiver(); diff --git a/src/displayable_tree.rs b/src/displayable_tree.rs index df21e47..52ea2a2 100644 --- a/src/displayable_tree.rs +++ b/src/displayable_tree.rs @@ -9,9 +9,9 @@ use { chrono::{offset::Local, DateTime}, crossterm::{ cursor, - queue, style::{Color, SetBackgroundColor}, terminal::{Clear, ClearType}, + QueueableCommand, }, std::{time::SystemTime}, termimad::{ @@ -180,7 +180,7 @@ impl<'s, 't> DisplayableTree<'s, 't> { }; for y in 0..self.area.height { if self.in_app { - queue!(f, cursor::MoveTo(0, y))?; + f.queue(cursor::MoveTo(0, y))?; } let mut line_index = y as usize; if line_index > 0 { @@ -243,10 +243,10 @@ impl<'s, 't> DisplayableTree<'s, 't> { self.skin.default.queue_bg(f)?; } if self.in_app { - queue!(f, Clear(ClearType::UntilNewLine))?; - queue!(f, SetBackgroundColor(Color::Reset))?; // to end selection background + f.queue(Clear(ClearType::UntilNewLine))?; + f.queue(SetBackgroundColor(Color::Reset))?; // to end selection background if let Some((sctop, scbottom)) = scrollbar { - queue!(f, cursor::MoveTo(self.area.width, y))?; + f.queue(cursor::MoveTo(self.area.width, y))?; let style = if sctop <= y && y <= scbottom { &self.skin.scrollbar_thumb } else { diff --git a/src/help_states.rs b/src/help_states.rs index 772a7e8..095a0f6 100644 --- a/src/help_states.rs +++ b/src/help_states.rs @@ -1,29 +1,30 @@ -use std::io::Write; -use crossterm::{ - queue, - terminal::{Clear, ClearType}, -}; -use termimad::{ - Area, - FmtText, - TextView, +use { + crate::{ + app_state::{AppState, AppStateCmdResult}, + app_context::AppContext, + commands::{Action, Command}, + conf::Conf, + errors::ProgramError, + help_content, + io::W, + screens::Screen, + status::Status, + task_sync::TaskLifetime, + verb_store::PrefixSearchResult, + verbs::VerbExecutor, + }, + crossterm::{ + terminal::{Clear, ClearType}, + QueueableCommand, + }, + termimad::{ + Area, + FmtText, + TextView, + }, }; -use crate::{ - app_state::{AppState, AppStateCmdResult}, - app_context::AppContext, - commands::{Action, Command}, - conf::Conf, - errors::ProgramError, - help_content, - io::W, - screens::Screen, - status::Status, - task_sync::TaskLifetime, - verb_store::PrefixSearchResult, - verbs::VerbExecutor, -}; /// an application state dedicated to help pub struct HelpState { @@ -144,7 +145,7 @@ impl AppState for HelpState { _con: &AppContext ) -> Result<(), ProgramError> { screen.skin.default.queue_bg(w)?; - queue!(w, Clear(ClearType::UntilNewLine))?; + w.queue(Clear(ClearType::UntilNewLine))?; Ok(()) } } diff --git a/src/screens.rs b/src/screens.rs index 2adaca9..40f29f1 100644 --- a/src/screens.rs +++ b/src/screens.rs @@ -1,21 +1,21 @@ -use std::io::Write; -use crossterm::{ - cursor, - terminal::{Clear, ClearType}, - queue, -}; -use termimad::{Area, CompoundStyle, InputField, MadSkin}; - -use crate::{ - app_context::AppContext, - errors::ProgramError, - io::W, - mad_skin::{ - self, - StatusMadSkinSet, +use { + crate::{ + app_context::AppContext, + errors::ProgramError, + io::W, + mad_skin::{ + self, + StatusMadSkinSet, + }, + skin::Skin, + }, + crossterm::{ + cursor, + terminal::{Clear, ClearType}, + QueueableCommand, }, - skin::Skin, + termimad::{Area, CompoundStyle, InputField, MadSkin}, }; pub static FLAGS_AREA_WIDTH: u16 = 10; @@ -70,17 +70,17 @@ impl Screen { x: u16, y: u16 ) -> Result<(), ProgramError> { - queue!(w, cursor::MoveTo(x, y))?; + w.queue(cursor::MoveTo(x, y))?; Ok(()) } /// clear the whole screen pub fn clear(&self, w: &mut W) -> Result<(), ProgramError> { - queue!(w, Clear(ClearType::All))?; + w.queue(Clear(ClearType::All))?; Ok(()) } /// clear from the cursor to the end of line pub fn clear_line(&self, w: &mut W) -> Result<(), ProgramError> { - queue!(w, Clear(ClearType::UntilNewLine))?; + w.queue(Clear(ClearType::UntilNewLine))?; Ok(()) } } |