mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
Fix different document panic (#3160)
Would panic when given the view for the current document for a different document.
This commit is contained in:
parent
1b3a10d906
commit
dfc31e74af
@ -878,6 +878,7 @@ pub fn switch(&mut self, id: DocumentId, action: Action) {
|
||||
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…
Reference in New Issue
Block a user