Fix crash on changing from empty scratch buffer to itself (#975)
This commit is contained in:
parent
7b65a6d687
commit
aa4d0b4646
1 changed files with 2 additions and 0 deletions
|
@ -240,6 +240,8 @@ impl Editor {
|
||||||
let remove_empty_scratch = !doc.is_modified()
|
let remove_empty_scratch = !doc.is_modified()
|
||||||
// If the buffer has no path and is not modified, it is an empty scratch buffer.
|
// If the buffer has no path and is not modified, it is an empty scratch buffer.
|
||||||
&& doc.path().is_none()
|
&& 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.
|
// Ensure the buffer is not displayed in any other splits.
|
||||||
&& !self
|
&& !self
|
||||||
.tree
|
.tree
|
||||||
|
|
Loading…
Reference in a new issue