aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorKyle L. Davis2022-07-23 09:42:28 +0000
committerGitHub2022-07-23 09:42:28 +0000
commitdfc31e74af1b96d9097496f1faa38710ecd30580 (patch)
treeb38de1af9b1bd6c1fa1febb3e92db2b841f31938 /helix-view/src
parent1b3a10d906843dab7faa5e0043841cd2b4c5e2dc (diff)
Fix different document panic (#3160)
Would panic when given the view for the current document for a different document.
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/editor.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 6cd4515c..7bfeb8db 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -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(