Skip to content

Commit

Permalink
solve symlink on :panel_right
Browse files Browse the repository at this point in the history
Fix #804
  • Loading branch information
Canop committed Nov 30, 2023
1 parent e0e886a commit 10113f3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/verb/internal_focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use {
task_sync::Dam,
tree::TreeOptions,
},
std::path::{Path, PathBuf},
std::{
fs,
path::{Path, PathBuf},
},
};

pub fn on_path(
Expand Down Expand Up @@ -50,13 +53,19 @@ pub fn new_state_on_path(
}

pub fn new_panel_on_path(
path: PathBuf,
mut path: PathBuf,
screen: Screen,
tree_options: TreeOptions,
purpose: PanelPurpose,
con: &AppContext,
direction: HDir,
) -> CmdResult {
// We try to canonicalize the path, mostly to resolve links
if let Ok(canonic) = fs::canonicalize(&path) {
path = canonic;
// If it can't be canonicalized, we'll let the panel state
// deal with the original path
}
if purpose.is_preview() {
let pattern = tree_options.pattern.tree_to_preview();
CmdResult::NewPanel {
Expand Down Expand Up @@ -135,7 +144,6 @@ fn path_from_input(
base_path.to_path_buf()
}
}

}

pub fn get_status_markdown(
Expand Down

0 comments on commit 10113f3

Please sign in to comment.