Fix panic in vim mode (#38437)

Release Notes:

- vim: Fixed a rare panic in search
This commit is contained in:
Conrad Irwin 2025-09-18 14:58:07 -06:00 committed by GitHub
parent 530225a06a
commit 82e1e5b7ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -222,7 +222,7 @@ impl Vim {
let mut count = self.search.count;
let direction = self.search.direction;
search_bar.has_active_match();
let new_head = new_selections.last().unwrap().start;
let new_head = new_selections.last()?.start;
let is_different_head = self
.search
.prior_selections