mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
Deleting the last entry in the shell command history leaves the suggestions list focused but empty. An empty list reports its selected index as -1 (ListCursor.clampValue), and the delete keybinding passes that index straight to HandleDeleteSuggestion, which subscripts GetItems() with it. Pressing delete a second time panics and takes lazygit down with it. To reproduce: press ":" and run any command, press ":" again, tab into the suggestions, then press "d" twice. The handler two lines below already returns early on a -1, with a comment saying it should never happen. That index comes from lo.IndexOf, so this one never got the same scrutiny. We guard the binding the way ConfirmSuggestion directly above it is already guarded, with singleItemSelected. The key is then disabled with the usual reason instead of firing on an empty list |
||
|---|---|---|
| .. | ||
| app | ||
| cheatsheet | ||
| commands | ||
| common | ||
| config | ||
| constants | ||
| env | ||
| fakes | ||
| gocui | ||
| gui | ||
| i18n | ||
| integration | ||
| jsonschema | ||
| logs | ||
| snake | ||
| tasks | ||
| theme | ||
| updates | ||
| utils | ||