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