diff options
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | Cargo.lock | 30 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | bacon.toml | 2 | ||||
-rw-r--r-- | src/browser/browser_state.rs | 6 | ||||
-rw-r--r-- | src/display/displayable_tree.rs | 2 | ||||
-rw-r--r-- | src/file_sum/sum_computation.rs | 2 | ||||
-rw-r--r-- | src/filesystems/filesystems_state.rs | 4 | ||||
-rw-r--r-- | src/help/help_state.rs | 2 | ||||
-rw-r--r-- | src/pattern/fuzzy_pattern.rs | 2 | ||||
-rw-r--r-- | src/syntactic/syntactic_view.rs | 2 | ||||
-rw-r--r-- | src/verb/internal_select.rs | 2 | ||||
-rw-r--r-- | website/docs/install-br.md | 8 |
13 files changed, 37 insertions, 31 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e9638a6..ed83a33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### v1.19.0 - 2023-01-03 +<a name="v1.19.0"></a> +- Nushell support - Fix #375 - Thanks @FrancescElies, @mediumrarez, and issue contributors + ### v1.18.0 - 2022-12-21 <a name="v1.18.0"></a> - Hjson configuration file can now omit outside braces (it's "braceless Hjson"), making it much cleaner @@ -140,7 +140,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "broot" -version = "1.18.0" +version = "1.19.0" dependencies = [ "ahash 0.7.6", "ansi_colours", @@ -813,9 +813,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "half" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554" +checksum = "6c467d36af040b7b2681f5fddd27427f6da8d3d072f575a265e181d2f8e8d157" dependencies = [ "crunchy", ] @@ -1015,9 +1015,9 @@ dependencies = [ [[package]] name = "lazy-regex" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9656bf98b413727b974a451039bc00ce546c3de9440cb4a7b65222b71e17cc" +checksum = "274ae5b8ca435c817dd3b9a92bfa93179189e9f6963879982c33c85895251981" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -1026,9 +1026,9 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3c3042a5f73640f091fda4175798f2b51c2107deeab18e3017873a4772dd36" +checksum = "9b2adfafeb53fa30d6998407a5465bcba4c36ed992131f790ea25d398e10f621" dependencies = [ "proc-macro2", "quote", @@ -1061,9 +1061,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.138" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libgit2-sys" @@ -1270,9 +1270,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "onig" @@ -1703,18 +1703,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.151" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.151" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -1,6 +1,6 @@ [package] name = "broot" -version = "1.18.0" +version = "1.19.0" authors = ["dystroy <denys.seguret@gmail.com>"] repository = "https://github.com/Canop/broot" homepage = "https://dystroy.org/broot" @@ -43,6 +43,8 @@ command = [ "-A", "clippy::neg_multiply", "-A", "clippy::vec_init_then_push", "-A", "clippy::if_same_then_else", + "-A", "clippy::manual_clamp", + "-A", "clippy::needless_bool", ] need_stdout = false diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index efa3192..8d6a455 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -56,7 +56,7 @@ impl BrowserState { let builder = TreeBuilder::from( path, options, - BrowserState::page_height(screen) as usize, + BrowserState::page_height(screen), con, )?; let tree = builder.build_tree(false, dam)?; @@ -656,7 +656,7 @@ impl PanelState for BrowserState { let mut options = self.tree.options.clone(); options.pattern = pattern; let root = self.tree.root().clone(); - let page_height = BrowserState::page_height(screen) as usize; + let page_height = BrowserState::page_height(screen); let builder = TreeBuilder::from(root, options, page_height, con)?; let filtered_tree = time!( Info, @@ -718,7 +718,7 @@ impl PanelState for BrowserState { } fn refresh(&mut self, screen: Screen, con: &AppContext) -> Command { - let page_height = BrowserState::page_height(screen) as usize; + let page_height = BrowserState::page_height(screen); // refresh the base tree if let Err(e) = self.tree.refresh(page_height, con) { warn!("refreshing base tree failed : {:?}", e); diff --git a/src/display/displayable_tree.rs b/src/display/displayable_tree.rs index f4f4974..1a92f4b 100644 --- a/src/display/displayable_tree.rs +++ b/src/display/displayable_tree.rs @@ -511,7 +511,7 @@ impl<'a, 's, 't> DisplayableTree<'a, 's, 't> { } let mut line_index = y as usize; if line_index > 0 { - line_index += tree.scroll as usize; + line_index += tree.scroll; } let mut selected = false; let mut cw = CropWriter::new(f, self.area.width as usize); diff --git a/src/file_sum/sum_computation.rs b/src/file_sum/sum_computation.rs index c997375..344f4a7 100644 --- a/src/file_sum/sum_computation.rs +++ b/src/file_sum/sum_computation.rs @@ -181,7 +181,7 @@ impl DirSummer { loop { let o = dirs_receiver.recv(); if let Ok(Some(open_dir)) = o { - if let Ok(entries) = fs::read_dir(&open_dir) { + if let Ok(entries) = fs::read_dir(open_dir) { for e in entries.flatten() { if let Ok(md) = e.metadata() { if md.is_dir() { diff --git a/src/filesystems/filesystems_state.rs b/src/filesystems/filesystems_state.rs index 553d742..b125268 100644 --- a/src/filesystems/filesystems_state.rs +++ b/src/filesystems/filesystems_state.rs @@ -125,7 +125,7 @@ impl FilesystemState { cycle: bool, ) -> CmdResult { let count = get_arg(input_invocation, internal_exec, 1); - let dir = dir * count as i32; + let dir = dir * count; if let Some(f) = self.filtered.as_mut() { f.selection_idx = move_sel(f.selection_idx, f.mounts.len(), dir, cycle); } else { @@ -353,7 +353,7 @@ impl PanelState for FilesystemState { cw.queue_g_string(border_style, format!("{:─>width$}", '┼', width = w_free+1))?; cw.fill(border_style, &BRANCH_FILLING)?; //- content - let mut idx = self.scroll as usize; + let mut idx = self.scroll; for y in 2..area.height { w.queue(cursor::MoveTo(area.left, y + area.top))?; let selected = selection_idx == idx; diff --git a/src/help/help_state.rs b/src/help/help_state.rs index 0021ae3..d37941f 100644 --- a/src/help/help_state.rs +++ b/src/help/help_state.rs @@ -232,7 +232,7 @@ impl PanelState for HelpState { }; CmdResult::Keep } - open_stay => match opener::open(&Conf::default_location()) { + open_stay => match opener::open(Conf::default_location()) { Ok(exit_status) => { info!("open returned with exit_status {:?}", exit_status); CmdResult::Keep diff --git a/src/pattern/fuzzy_pattern.rs b/src/pattern/fuzzy_pattern.rs index 457b5bc..d38036c 100644 --- a/src/pattern/fuzzy_pattern.rs +++ b/src/pattern/fuzzy_pattern.rs @@ -146,7 +146,7 @@ impl FuzzyPattern { let match_len = 1 + cand_idx - pos[0]; let mut score = BONUS_MATCH; score += BONUS_CANDIDATE_LENGTH * (cand_chars.len() as i32); - score += BONUS_SINGLED_CHAR * (nb_singled_chars as i32); + score += BONUS_SINGLED_CHAR * nb_singled_chars; score += BONUS_NB_HOLES * (nb_holes as i32); score += match_len as i32 * BONUS_MATCH_LENGTH; if pos[0] == 0 { diff --git a/src/syntactic/syntactic_view.rs b/src/syntactic/syntactic_view.rs index 098d9fb..ad42fa6 100644 --- a/src/syntactic/syntactic_view.rs +++ b/src/syntactic/syntactic_view.rs @@ -332,7 +332,7 @@ impl SyntacticView { for y in 0..line_count { w.queue(cursor::MoveTo(area.left, y as u16 + area.top))?; let mut cw = CropWriter::new(w, code_width); - let line_idx = self.scroll as usize + y; + let line_idx = self.scroll + y; let selected = self.selection_idx == Some(line_idx); let bg = if selected { selection_bg } else { normal_bg }; let mut op_mmap: Option<Mmap> = None; diff --git a/src/verb/internal_select.rs b/src/verb/internal_select.rs index ae1b2f7..4dd195b 100644 --- a/src/verb/internal_select.rs +++ b/src/verb/internal_select.rs @@ -139,7 +139,7 @@ pub fn on_path( warn!("bang in :select isn't supported yet"); } if tree.try_select_path(&path) { - tree.make_selection_visible(BrowserState::page_height(screen) as usize); + tree.make_selection_visible(BrowserState::page_height(screen)); } CmdResult::Keep } diff --git a/website/docs/install-br.md b/website/docs/install-br.md index 3e1ac2d..ff6e78c 100644 --- a/website/docs/install-br.md +++ b/website/docs/install-br.md @@ -7,12 +7,12 @@ But broot needs a companion function in the shell in order to be able to change This is normally the easiest solution and it's safe. -When you start broot, it checks whether the `br` shell function seems to have been installed (or -to have been refused). If needed, and if the used shell seems compatible (supported shells today are bash, zsh and fish), -then broot asks the permission to register this shell function. +When you start broot, it checks whether the `br` shell function seems to have been installed (or to have been refused). If needed, and if the used shell seems compatible, then broot asks the permission to register this shell function. When it's done, you can do `br` to launch broot, and typing <kbd>alt</kbd><kbd>enter</kbd> will cd for you. +Supported shells today are bash, zsh, fish, and nushell. + # Retry the automatic installation If you have messed with the configuration files, you might want to have the shell function reinstalled. @@ -25,7 +25,7 @@ You can also use the `--install` argument when you first refused and then decide If you prefer to manage the function sourcing yourself, or to automate the installation your way, or if you use an unsupported configuration, you still can get some help of broot: -`broot --print-shell-function bash` (you can replace `bash` with either `zsh` or `fish`) outputs a recommended shell function. +`broot --print-shell-function bash` (you can replace `bash` with `zsh`, `fish`, or `nushell`) outputs a recommended shell function. `broot --set-install-state installed` tells broot the `br` function is installed (other possible values are `undefined` and `refused`). |