diff options
author | Aram Drevekenin <aram@poor.dev> | 2021-09-30 10:48:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 10:48:40 +0200 |
commit | af62afec9cb11ec7fc5737e6bc369c60f591f86a (patch) | |
tree | 2f727e36fbbaf338ceadc3726c4be045c28595a9 /default-plugins | |
parent | d001dea238619e1ce58e090b3e9d2368063bcf72 (diff) |
fix(strider): do not descend into host folder (#753)
Diffstat (limited to 'default-plugins')
-rw-r--r-- | default-plugins/strider/src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/default-plugins/strider/src/main.rs b/default-plugins/strider/src/main.rs index 701e02bde..f0b5cebfc 100644 --- a/default-plugins/strider/src/main.rs +++ b/default-plugins/strider/src/main.rs @@ -35,8 +35,14 @@ impl ZellijPlugin for State { } } Key::Left | Key::Char('h') => { - self.path.pop(); - refresh_directory(self); + if self.path.components().count() > 2 { + // don't descend into /host + // the reason this is a hard-coded number (2) and not "== ROOT" + // or some such is that there are certain cases in which self.path + // is empty and this will work then too + self.path.pop(); + refresh_directory(self); + } } Key::Char('.') => { |