Fix different document panic (#3160)

Would panic when given the view for the current document for a different document.
pull/3170/head
Kyle L. Davis 2 years ago committed by GitHub
parent 1b3a10d906
commit dfc31e74af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -878,6 +878,7 @@ impl Editor {
let view = self
.tree
.try_get(self.tree.focus)
.filter(|v| id == v.doc) // Different Document
.cloned()
.unwrap_or_else(|| View::new(id, self.config().gutters.clone()));
let view_id = self.tree.split(

Loading…
Cancel
Save