Skip to content

Commit

Permalink
fix: canonicalize paths (lapce#1469)
Browse files Browse the repository at this point in the history
  • Loading branch information
panekj authored Oct 10, 2022
1 parent 5e507aa commit c880b15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lapce-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ pub fn mainloop() {
let cli = Cli::parse();
if !cli.proxy {
let pwd = std::env::current_dir().unwrap_or_default();
let paths: Vec<_> = cli.paths.iter().map(|p| pwd.join(p)).collect();
let paths: Vec<_> = cli
.paths
.iter()
.map(|p| pwd.join(p).canonicalize().unwrap_or_default())
.collect();
let _ = try_open_in_existing_process(&paths);
return;
}
Expand Down
6 changes: 5 additions & 1 deletion lapce-ui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ pub fn build_window(data: &mut LapceWindowData) -> impl Widget<LapceData> {
pub fn launch() {
let cli = Cli::parse();
let pwd = std::env::current_dir().unwrap_or_default();
let paths: Vec<PathBuf> = cli.paths.iter().map(|p| pwd.join(p)).collect();
let paths: Vec<PathBuf> = cli
.paths
.iter()
.map(|p| pwd.join(p).canonicalize().unwrap_or_default())
.collect();
if !cli.new && LapceData::try_open_in_existing_process(&paths).is_ok() {
return;
}
Expand Down

0 comments on commit c880b15

Please sign in to comment.