mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-18 21:17:08 +04:00
Add directory name to :cd
errors
For example `:cd README.md` would say "Not a directory" but would not print the directory name. Now the error message includes some context about the operation and requested directory.
This commit is contained in:
parent
b05971f178
commit
0f2ce303c5
@ -1105,7 +1105,12 @@ fn change_current_directory(
|
|||||||
None => Cow::Owned(home_dir()?),
|
None => Cow::Owned(home_dir()?),
|
||||||
};
|
};
|
||||||
|
|
||||||
cx.editor.set_cwd(&dir)?;
|
cx.editor.set_cwd(&dir).map_err(|err| {
|
||||||
|
anyhow!(
|
||||||
|
"Could not change working directory to '{}': {err}",
|
||||||
|
dir.display()
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
cx.editor.set_status(format!(
|
cx.editor.set_status(format!(
|
||||||
"Current working directory is now {}",
|
"Current working directory is now {}",
|
||||||
|
Loading…
Reference in New Issue
Block a user