mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 13:37:06 +04:00
Fix crash on changing from empty scratch buffer to itself (#975)
This commit is contained in:
parent
7b65a6d687
commit
aa4d0b4646
@ -240,6 +240,8 @@ pub fn switch(&mut self, id: DocumentId, action: Action) {
|
||||
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…
Reference in New Issue
Block a user