Allow opening non-extant files (#9256)
Fixes #7400 Release Notes: - Improved the `zed` command to not create files until you save them in the editor ([#7400](https://github.com/zed-industries/zed/issues/7400)).
This commit is contained in:
parent
e792c1a5c5
commit
646f69583a
11 changed files with 242 additions and 152 deletions
|
@ -2108,7 +2108,11 @@ impl NavHistoryState {
|
|||
fn dirty_message_for(buffer_path: Option<ProjectPath>) -> String {
|
||||
let path = buffer_path
|
||||
.as_ref()
|
||||
.and_then(|p| p.path.to_str())
|
||||
.and_then(|p| {
|
||||
p.path
|
||||
.to_str()
|
||||
.and_then(|s| if s == "" { None } else { Some(s) })
|
||||
})
|
||||
.unwrap_or("This buffer");
|
||||
let path = truncate_and_remove_front(path, 80);
|
||||
format!("{path} contains unsaved edits. Do you want to save it?")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue