summaryrefslogtreecommitdiffstats
path: root/src/commands/mod.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-03-02 17:37:02 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-03-02 17:37:02 -0500
commit094015e44075da9e56e90a5dce2be2d99e5b546d (patch)
tree1d4314f0ddac99f462aaece5ba51c5e86fd88960 /src/commands/mod.rs
parentfbf2f40d909a537b9c6e58926f03f648041d2c01 (diff)
add support for search_next and search_prev commands
- search is now stateful and keeps track of last search pattern - search_next will go to the next file that satisfies search pattern - search_prev will go to the previous file that satisfies search pattern
Diffstat (limited to 'src/commands/mod.rs')
-rw-r--r--src/commands/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index f6e0e7f..b58fd0f 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -28,7 +28,7 @@ pub use self::quit::ForceQuit;
pub use self::quit::Quit;
pub use self::reload_dir::ReloadDirList;
pub use self::rename_file::{RenameFile, RenameFileMethod};
-pub use self::search::Search;
+pub use self::search::{Search, SearchNext, SearchPrev};
pub use self::selection::SelectFiles;
pub use self::set_mode::SetMode;
pub use self::show_hidden::ToggleHiddenFiles;
@@ -166,6 +166,8 @@ pub fn from_args(command: &str, args: Option<&Vec<String>>) -> Option<Box<Joshut
Some(Box::new(self::RenameFile::new(method)))
}
"search" => Some(Box::new(self::Search::new())),
+ "search_next" => Some(Box::new(self::SearchNext::new())),
+ "search_prev" => Some(Box::new(self::SearchPrev::new())),
"select_files" => {
let mut toggle = false;
let mut all = false;