Skip to content

Commit

Permalink
Fix different document panic (#3160)
Browse files Browse the repository at this point in the history
Would panic when given the view for the current document for a different document.
  • Loading branch information
AceofSpades5757 committed Jul 23, 2022
1 parent 1b3a10d commit dfc31e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit dfc31e7

Please sign in to comment.