Skip to content

Commit

Permalink
don't canonicalize paths on windows on new panels
Browse files Browse the repository at this point in the history
Fix #809

It's thus possible that issue #804 exists on Windows, I can't test that.
  • Loading branch information
Canop committed Dec 22, 2023
1 parent c12f94f commit e8b119d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/verb/internal_focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use {
tree::TreeOptions,
},
std::{
fs,
path::{Path, PathBuf},
},
};
Expand Down Expand Up @@ -53,6 +52,7 @@ pub fn new_state_on_path(
)
}

#[allow(unused_mut)]
pub fn new_panel_on_path(
mut path: PathBuf,
screen: Screen,
Expand All @@ -61,8 +61,10 @@ pub fn new_panel_on_path(
con: &AppContext,
direction: HDir,
) -> CmdResult {
#[cfg(not(windows))]
// We try to canonicalize the path, mostly to resolve links
if let Ok(canonic) = fs::canonicalize(&path) {
// We don't do it on Windows due to issue #809
if let Ok(canonic) = std::fs::canonicalize(&path) {
path = canonic;
// If it can't be canonicalized, we'll let the panel state
// deal with the original path
Expand Down

0 comments on commit e8b119d

Please sign in to comment.