mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +00:00
Fix underflow potential
This commit is contained in:
parent
dd73233973
commit
ce8442a3d8
1 changed files with 1 additions and 1 deletions
|
@ -1079,7 +1079,7 @@ impl CopilotState {
|
|||
match direction {
|
||||
Direction::Prev => {
|
||||
self.active_completion_index = if self.active_completion_index == 0 {
|
||||
self.completions.len() - 1
|
||||
self.completions.len().saturating_sub(1)
|
||||
} else {
|
||||
self.active_completion_index - 1
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue