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