diff options
author | Kyle L. Davis | 2022-07-23 09:42:28 +0000 |
---|---|---|
committer | GitHub | 2022-07-23 09:42:28 +0000 |
commit | dfc31e74af1b96d9097496f1faa38710ecd30580 (patch) | |
tree | b38de1af9b1bd6c1fa1febb3e92db2b841f31938 | |
parent | 1b3a10d906843dab7faa5e0043841cd2b4c5e2dc (diff) |
Fix different document panic (#3160)
Would panic when given the view for the current document for a different document.
-rw-r--r-- | helix-view/src/editor.rs | 1 |
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( |