summaryrefslogtreecommitdiffstats
path: root/src/launchable.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-06-28 15:33:43 +0200
committerCanop <cano.petrole@gmail.com>2020-06-28 15:33:43 +0200
commit3accec2a8ea0827b84b7014744cfe94834cc18d5 (patch)
tree33455c638391102566c2c3db8d4bed876b7cd2a7 /src/launchable.rs
parent6ae4cc421ef3db9f6f458a023780af899313f821 (diff)
new `cols_order` attribute in configurationv0.18.1
Allows setting the order of columns, most notably the position of the branch (left of the tree, just before the name, or in between). Fix #127
Diffstat (limited to 'src/launchable.rs')
-rw-r--r--src/launchable.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/launchable.rs b/src/launchable.rs
index 6c99796..0c81b22 100644
--- a/src/launchable.rs
+++ b/src/launchable.rs
@@ -1,6 +1,6 @@
use {
crate::{
- display::{DisplayableTree, Screen, W},
+ display::{Cols, DisplayableTree, Screen, W},
errors::ProgramError,
skin::StyleMap,
tree::Tree,
@@ -30,6 +30,7 @@ pub enum Launchable {
// print the tree on end of broot
tree: Box<Tree>,
skin: Box<StyleMap>,
+ cols: Cols,
width: u16,
},
Program {
@@ -70,10 +71,12 @@ impl Launchable {
tree: &Tree,
screen: &Screen,
style_map: StyleMap,
+ cols: Cols,
) -> Launchable {
Launchable::TreePrinter {
tree: Box::new(tree.clone()),
skin: Box::new(style_map),
+ cols,
width: screen.width,
}
}
@@ -95,8 +98,8 @@ impl Launchable {
println!("{}", to_print);
Ok(())
}
- Launchable::TreePrinter { tree, skin, width } => {
- let dp = DisplayableTree::out_of_app(&tree, &skin, *width);
+ Launchable::TreePrinter { tree, skin, cols, width } => {
+ let dp = DisplayableTree::out_of_app(&tree, &skin, &cols, *width);
dp.write_on(&mut std::io::stdout())
}
Launchable::Program { exe, args } => {