mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-26 03:59:55 +00:00
Avoid subtraction underflow when searching terminal
Co-authored-by: Keith Simmons <keith@zed.dev>
This commit is contained in:
parent
0e0bae8faa
commit
f87e7d3bed
1 changed files with 1 additions and 1 deletions
|
@ -432,7 +432,7 @@ impl SearchableItem for TerminalContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no selection after selection head, return the last match
|
// If no selection after selection head, return the last match
|
||||||
return Some(matches.len() - 1);
|
return Some(matches.len().saturating_sub(1));
|
||||||
} else {
|
} else {
|
||||||
Some(0)
|
Some(0)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue