summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-04-19 13:36:50 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-04-19 13:36:50 -0400
commit44252aa792dfae24a63cd727c1ff0bf032d8cf9f (patch)
tree9242f6769ef3e368c6c0f46ae7923461ed7f8fa3
parent97434b87b049a8567dc65adc3756ac6f13a36940 (diff)
remove functionality from commands/mod.rs
-rw-r--r--src/commands/cursor_move.rs12
-rw-r--r--src/commands/mod.rs23
2 files changed, 8 insertions, 27 deletions
diff --git a/src/commands/cursor_move.rs b/src/commands/cursor_move.rs
index 5899a9b..4a3dea4 100644
--- a/src/commands/cursor_move.rs
+++ b/src/commands/cursor_move.rs
@@ -13,13 +13,13 @@ impl CursorMove {
if let Some(curr_list) = curr_tab.curr_list.as_mut() {
match curr_list.index {
None => {}
- Some(index) => {
+ Some(_) => {
let dir_len = curr_list.contents.len();
-/*
- if index == dir_len - 1 {
- return;
- }
-*/
+ /*
+ if index == dir_len - 1 {
+ return;
+ }
+ */
if new_index >= dir_len {
new_index = dir_len - 1;
}
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 57694c5..d091cd4 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -42,7 +42,6 @@ use std::path::PathBuf;
use crate::context::JoshutoContext;
use crate::error::JoshutoError;
-use crate::structs;
use crate::window::JoshutoView;
#[derive(Debug)]
@@ -236,26 +235,7 @@ pub fn from_args(command: &str, args: Option<&Vec<String>>) -> Option<Box<Joshut
}
}
-pub fn collect_selected_paths(dirlist: &structs::JoshutoDirList) -> Option<Vec<PathBuf>> {
- match dirlist.index {
- Some(index) => {
- let selected: Vec<PathBuf> = dirlist
- .contents
- .iter()
- .filter(|entry| entry.selected)
- .map(|entry| entry.path.clone())
- .collect();
- if !selected.is_empty() {
- Some(selected)
- } else {
- Some(vec![dirlist.contents[index].path.clone()])
- }
- }
- None => None,
- }
-}
-
-#[allow(dead_code)]
+/*
pub fn split_shell_style(line: &str) -> Vec<&str> {
let mut args: Vec<&str> = Vec::new();
let mut char_ind = line.char_indices();
@@ -289,3 +269,4 @@ pub fn split_shell_style(line: &str) -> Vec<&str> {
}
args
}
+*/