project_search: Guard replace_next match lookup (#48327)
Release Notes: - N/A Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
This commit is contained in:
1 parent
2c8bbfe182
commit
ef94395614
1 file changed
+4
-3
@@ -728,10 +728,11 @@ impl ProjectSearchView {
|
||||
if let Some(query) = query {
|
||||
let query = query.with_replacement(self.replacement(cx));
|
||||
|
||||
// TODO: Do we need the clone here?
|
||||
let mat = self.entity.read(cx).match_ranges[active_index].clone();
|
||||
let mat = self.entity.read(cx).match_ranges.get(active_index).cloned();
|
||||
self.results_editor.update(cx, |editor, cx| {
|
||||
editor.replace(&mat, &query, window, cx);
|
||||
if let Some(mat) = mat.as_ref() {
|
||||
editor.replace(mat, &query, window, cx);
|
||||
}
|
||||
});
|
||||
self.select_match(Direction::Next, window, cx)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user