summaryrefslogtreecommitdiffstats
path: root/src/commands/cursor_move.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-18 22:55:09 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-18 22:55:09 -0400
commit06b2d7730d10240b471e859c7988ed219aa4c590 (patch)
treef5dcca189bb2d79c4def09540eec73cdb832c6b8 /src/commands/cursor_move.rs
parentf3081669e488c54ab4fcae2829ea2f58f082c6e7 (diff)
remove cursormovestub and add rudimentary sort command
Diffstat (limited to 'src/commands/cursor_move.rs')
-rw-r--r--src/commands/cursor_move.rs36
1 files changed, 1 insertions, 35 deletions
diff --git a/src/commands/cursor_move.rs b/src/commands/cursor_move.rs
index ba536bb..a19c264 100644
--- a/src/commands/cursor_move.rs
+++ b/src/commands/cursor_move.rs
@@ -30,46 +30,12 @@ pub fn cursor_move(new_index: usize, context: &mut JoshutoContext) {
if path.is_dir() {
curr_tab
.history
- .create_or_update(path.as_path(), &context.config_t.sort_option);
+ .create_or_soft_update(path.as_path(), &context.config_t.sort_option);
}
}
}
#[derive(Clone, Debug)]
-pub struct CursorMoveStub {}
-
-impl CursorMoveStub {
- pub fn new() -> Self {
- Self {}
- }
- pub const fn command() -> &'static str {
- "cursor_move_stub"
- }
-}
-
-impl JoshutoCommand for CursorMoveStub {}
-
-impl std::fmt::Display for CursorMoveStub {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
- write!(f, "{}", Self::command())
- }
-}
-
-impl JoshutoRunnable for CursorMoveStub {
- fn execute(&self, context: &mut JoshutoContext, _: &mut TuiBackend) -> JoshutoResult<()> {
- let new_index = match context.curr_tab_ref().curr_list_ref() {
- Some(curr_list) => curr_list.index,
- None => None,
- };
-
- if let Some(s) = new_index {
- cursor_move(s, context)
- }
- Ok(())
- }
-}
-
-#[derive(Clone, Debug)]
pub struct CursorMoveDown {
movement: usize,
}