Fix crash on changing from empty scratch buffer to itself (#975)

pull/589/head
ath3 3 years ago committed by GitHub
parent 7b65a6d687
commit aa4d0b4646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -240,6 +240,8 @@ impl Editor {
let remove_empty_scratch = !doc.is_modified()
// If the buffer has no path and is not modified, it is an empty scratch buffer.
&& doc.path().is_none()
// If the buffer we are changing to is not this buffer
&& id != doc.id
// Ensure the buffer is not displayed in any other splits.
&& !self
.tree

Loading…
Cancel
Save