aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/strider/src
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2022-06-10 20:03:13 +0200
committerGitHub <noreply@github.com>2022-06-10 20:03:13 +0200
commit67d2673cae60954e8287c2a1f58a21a56e066afb (patch)
tree5c469728075ea59723951c6b535253e30ebeaec4 /default-plugins/strider/src
parentadd: typos (diff)
downloadsl0ppij-67d2673cae60954e8287c2a1f58a21a56e066afb.tar.gz
sl0ppij-67d2673cae60954e8287c2a1f58a21a56e066afb.tar.xz
sl0ppij-67d2673cae60954e8287c2a1f58a21a56e066afb.zip
add(style): add trailing comma in match blocks (#1483)
This makes it easier to distinguish from normal blocks
Diffstat (limited to 'default-plugins/strider/src')
-rw-r--r--default-plugins/strider/src/main.rs20
-rw-r--r--default-plugins/strider/src/state.rs2
2 files changed, 11 insertions, 11 deletions
diff --git a/default-plugins/strider/src/main.rs b/default-plugins/strider/src/main.rs
index 4ce0b043..22ca1c61 100644
--- a/default-plugins/strider/src/main.rs
+++ b/default-plugins/strider/src/main.rs
@@ -24,15 +24,15 @@ impl ZellijPlugin for State {
Event::Key(key) => match key {
Key::Up | Key::Char('k') => {
*self.selected_mut() = self.selected().saturating_sub(1);
- }
+ },
Key::Down | Key::Char('j') => {
let next = self.selected().saturating_add(1);
*self.selected_mut() = min(self.files.len().saturating_sub(1), next);
- }
+ },
Key::Right | Key::Char('\n') | Key::Char('l') if !self.files.is_empty() => {
self.traverse_dir_or_open_file();
self.ev_history.clear();
- }
+ },
Key::Left | Key::Char('h') => {
if self.path.components().count() > 2 {
// don't descend into /host
@@ -42,11 +42,11 @@ impl ZellijPlugin for State {
self.path.pop();
refresh_directory(self);
}
- }
+ },
Key::Char('.') => {
self.toggle_hidden_files();
refresh_directory(self);
- }
+ },
_ => (),
},
@@ -54,10 +54,10 @@ impl ZellijPlugin for State {
Mouse::ScrollDown(_) => {
let next = self.selected().saturating_add(1);
*self.selected_mut() = min(self.files.len().saturating_sub(1), next);
- }
+ },
Mouse::ScrollUp(_) => {
*self.selected_mut() = self.selected().saturating_sub(1);
- }
+ },
Mouse::Release(line, _) => {
if line < 0 {
return;
@@ -75,12 +75,12 @@ impl ZellijPlugin for State {
if should_select && self.scroll() + (line as usize) < self.files.len() {
*self.selected_mut() = self.scroll() + (line as usize);
}
- }
- _ => {}
+ },
+ _ => {},
},
_ => {
dbg!("Unknown event {:?}", event);
- }
+ },
}
}
diff --git a/default-plugins/strider/src/state.rs b/default-plugins/strider/src/state.rs
index 81d44a61..05ede0df 100644
--- a/default-plugins/strider/src/state.rs
+++ b/default-plugins/strider/src/state.rs
@@ -39,7 +39,7 @@ impl State {
FsEntry::Dir(p, _) => {
self.path = p;
refresh_directory(self);
- }
+ },
FsEntry::File(p, _) => open_file(p.strip_prefix(ROOT).unwrap()),
}
}