Skip to content

Commit

Permalink
fixup! helix-view/view: impl method to remove document from jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-h committed Nov 9, 2021
1 parent e51386c commit 1e9c14b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helix-view/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ impl JumpList {
}

pub fn remove(&mut self, doc_id: &DocumentId) {
self.jumps.retain(|(other_id, _)| other_id != doc_id);
if let Some(index) = self
.jumps
.iter()
.position(|(other_id, _)| other_id == doc_id)
{
self.jumps.remove(index);
}
}
}

Expand Down

0 comments on commit 1e9c14b

Please sign in to comment.