diff options
author | Canop <cano.petrole@gmail.com> | 2020-12-13 16:41:35 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-12-13 17:22:07 +0100 |
commit | 2c06c7ca0a580618d932325e15d8d40e7640f24d (patch) | |
tree | 5764d009d564a514a285426be6ce497cc65660c9 /src/conf/mod.rs | |
parent | ee4f93f4919be4e716bb9b73476473bbc8bd7159 (diff) |
keep selection visible on unfiltering
The selection was sometimes scrolled away on unfiltering.
Also change some formatting.
Diffstat (limited to 'src/conf/mod.rs')
-rw-r--r-- | src/conf/mod.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/conf/mod.rs b/src/conf/mod.rs index d2a0605..c9bbf4a 100644 --- a/src/conf/mod.rs +++ b/src/conf/mod.rs @@ -1,8 +1,6 @@ use { directories, - std::{ - path::{Path, PathBuf}, - }, + std::path::{Path, PathBuf}, }; mod conf; @@ -21,12 +19,12 @@ pub fn app_dirs() -> directories::ProjectDirs { .expect("Unable to find configuration directories") } -#[cfg(not(target_os="macos"))] +#[cfg(not(target_os = "macos"))] fn find_conf_dir() -> PathBuf { app_dirs().config_dir().to_path_buf() } -#[cfg(target_os="macos")] +#[cfg(target_os = "macos")] fn find_conf_dir() -> PathBuf { if let Some(user_dirs) = directories::UserDirs::new() { // We first search in ~/.config/broot which should be the prefered solution @@ -40,9 +38,9 @@ fn find_conf_dir() -> PathBuf { // See https://github.com/Canop/broot/issues/103 let second_choice = app_dirs().config_dir().to_path_buf(); if second_choice.exists() { - // An older version of broot was used to write the - // config, we don't want to lose it. - return second_choice; + // An older version of broot was used to write the + // config, we don't want to lose it. + return second_choice; } // Either the config has been scraped or it's a new installation return prefered; |