fix(strider): do not descend into host folder (#753)

This commit is contained in:
Aram Drevekenin 2021-09-30 10:48:40 +02:00 committed by GitHub
parent d001dea238
commit af62afec9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,8 +35,14 @@ impl ZellijPlugin for State {
} }
} }
Key::Left | Key::Char('h') => { Key::Left | Key::Char('h') => {
self.path.pop(); if self.path.components().count() > 2 {
refresh_directory(self); // 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('.') => { Key::Char('.') => {