mirror of
https://github.com/helix-editor/helix.git
synced 2024-12-18 14:01:55 +04:00
Expand tildes in :read
command (#12271)
This commit is contained in:
parent
99fdbce566
commit
3b36cf1a15
@ -2507,7 +2507,8 @@ fn read(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
|
||||
ensure!(args.len() == 1, "only the file name is expected");
|
||||
|
||||
let filename = args.first().unwrap();
|
||||
let path = PathBuf::from(filename.to_string());
|
||||
let path = helix_stdx::path::expand_tilde(PathBuf::from(filename.to_string()));
|
||||
|
||||
ensure!(
|
||||
path.exists() && path.is_file(),
|
||||
"path is not a file: {:?}",
|
||||
|
Loading…
Reference in New Issue
Block a user