aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 633e2541..63a4ab29 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -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