diff options
author | Brooks J Rady <b.j.rady@gmail.com> | 2021-09-19 16:38:36 +0100 |
---|---|---|
committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-09-19 16:38:36 +0100 |
commit | c29b8e98bf0fa37bd68f70f82b8fc02b727bb50c (patch) | |
tree | 579f8b41ae7ae1798fa1111a6022a050db1fd68b /default-plugins | |
parent | 1a1c10a22674522ab7b15a352ef77ca0bfb1991f (diff) |
fix(strider): update host mount-point
Diffstat (limited to 'default-plugins')
-rw-r--r-- | default-plugins/strider/src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/default-plugins/strider/src/main.rs b/default-plugins/strider/src/main.rs index 8edc1e197..701e02bde 100644 --- a/default-plugins/strider/src/main.rs +++ b/default-plugins/strider/src/main.rs @@ -2,9 +2,11 @@ mod state; use colored::*; use state::{FsEntry, State}; -use std::{cmp::min, fs::read_dir}; +use std::{cmp::min, fs::read_dir, path::Path}; use zellij_tile::prelude::*; +const ROOT: &str = "/host"; + register_plugin!(State); impl ZellijPlugin for State { @@ -29,7 +31,7 @@ impl ZellijPlugin for State { self.path = p; refresh_directory(self); } - FsEntry::File(p, _) => open_file(&p), + FsEntry::File(p, _) => open_file(p.strip_prefix(ROOT).unwrap()), } } Key::Left | Key::Char('h') => { @@ -76,7 +78,7 @@ impl ZellijPlugin for State { } fn refresh_directory(state: &mut State) { - state.files = read_dir(&state.path) + state.files = read_dir(Path::new(ROOT).join(&state.path)) .unwrap() .filter_map(|res| { res.and_then(|d| { |