mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
PageUp/PageDown for explorer TAB
This commit is contained in:
@@ -877,6 +877,23 @@ impl FileTransferActivity {
|
|||||||
self.local.index += 1;
|
self.local.index += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
KeyCode::PageUp => {
|
||||||
|
// Move index up (fast)
|
||||||
|
if self.local.index > 8 {
|
||||||
|
self.local.index = self.local.index - 8; // Decrease by `8` if possible
|
||||||
|
} else {
|
||||||
|
self.local.index = 0; // Set to 0 otherwise
|
||||||
|
}
|
||||||
|
}
|
||||||
|
KeyCode::PageDown => {
|
||||||
|
// Move index down (fast)
|
||||||
|
if self.local.index + 8 >= self.local.files.len() {
|
||||||
|
// If overflows, set to size
|
||||||
|
self.local.index = self.local.files.len() - 1;
|
||||||
|
} else {
|
||||||
|
self.local.index = self.local.index + 8; // Increase by `8`
|
||||||
|
}
|
||||||
|
}
|
||||||
KeyCode::Enter => {
|
KeyCode::Enter => {
|
||||||
// Match selected file
|
// Match selected file
|
||||||
let local_files: Vec<FsEntry> = self.local.files.clone();
|
let local_files: Vec<FsEntry> = self.local.files.clone();
|
||||||
@@ -1026,6 +1043,23 @@ impl FileTransferActivity {
|
|||||||
self.remote.index += 1;
|
self.remote.index += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
KeyCode::PageUp => {
|
||||||
|
// Move index up (fast)
|
||||||
|
if self.remote.index > 8 {
|
||||||
|
self.remote.index = self.remote.index - 8; // Decrease by `8` if possible
|
||||||
|
} else {
|
||||||
|
self.remote.index = 0; // Set to 0 otherwise
|
||||||
|
}
|
||||||
|
}
|
||||||
|
KeyCode::PageDown => {
|
||||||
|
// Move index down (fast)
|
||||||
|
if self.remote.index + 8 >= self.remote.files.len() {
|
||||||
|
// If overflows, set to size
|
||||||
|
self.remote.index = self.remote.files.len() - 1;
|
||||||
|
} else {
|
||||||
|
self.remote.index = self.remote.index + 8; // Increase by `8`
|
||||||
|
}
|
||||||
|
}
|
||||||
KeyCode::Enter => {
|
KeyCode::Enter => {
|
||||||
// Match selected file
|
// Match selected file
|
||||||
let files: Vec<FsEntry> = self.remote.files.clone();
|
let files: Vec<FsEntry> = self.remote.files.clone();
|
||||||
@@ -2038,6 +2072,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("quit"),
|
Span::raw("quit"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2048,6 +2083,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("change input field"),
|
Span::raw("change input field"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2058,8 +2094,31 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("change explorer tab"),
|
Span::raw("change explorer tab"),
|
||||||
])),
|
])),
|
||||||
|
ListItem::new(Spans::from(vec![
|
||||||
|
Span::styled(
|
||||||
|
"<UP/DOWN>",
|
||||||
|
Style::default()
|
||||||
|
.bg(Color::Cyan)
|
||||||
|
.fg(Color::White)
|
||||||
|
.add_modifier(Modifier::BOLD),
|
||||||
|
),
|
||||||
|
Span::raw(" "),
|
||||||
|
Span::raw("move up/down in list"),
|
||||||
|
])),
|
||||||
|
ListItem::new(Spans::from(vec![
|
||||||
|
Span::styled(
|
||||||
|
"<PAGEUP/PAGEDOWN>",
|
||||||
|
Style::default()
|
||||||
|
.bg(Color::Cyan)
|
||||||
|
.fg(Color::White)
|
||||||
|
.add_modifier(Modifier::BOLD),
|
||||||
|
),
|
||||||
|
Span::raw(" "),
|
||||||
|
Span::raw("scroll up/down in list quickly"),
|
||||||
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
Span::styled(
|
Span::styled(
|
||||||
"<ENTER>",
|
"<ENTER>",
|
||||||
@@ -2068,6 +2127,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("enter directory"),
|
Span::raw("enter directory"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2078,6 +2138,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("upload/download file"),
|
Span::raw("upload/download file"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2088,6 +2149,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("make directory"),
|
Span::raw("make directory"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2098,6 +2160,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("goto path"),
|
Span::raw("goto path"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2108,6 +2171,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("rename file"),
|
Span::raw("rename file"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2118,6 +2182,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("go to parent directory"),
|
Span::raw("go to parent directory"),
|
||||||
])),
|
])),
|
||||||
ListItem::new(Spans::from(vec![
|
ListItem::new(Spans::from(vec![
|
||||||
@@ -2128,6 +2193,7 @@ impl FileTransferActivity {
|
|||||||
.fg(Color::White)
|
.fg(Color::White)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
),
|
),
|
||||||
|
Span::raw(" "),
|
||||||
Span::raw("delete file"),
|
Span::raw("delete file"),
|
||||||
])),
|
])),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user