mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-24 08:52:21 +02:00
0b70dfbf46
It would crash when some keybindings are set to null, and the filter string is such that only those keybindings remain visible. The reason for the crash is that when inserting non-model items (menu section headers in this case) you specify a column to align them to. This works on the assumption that the number of columns is always the same. It can cope with the case that columns are removed because they are empty for all items; but it can't cope with the case that the getDisplayStrings function returns a lower number of columns. And this is what happened here: MenuViewModel.GetDisplayStrings would omit the keybinding column when none of the entries have a keybinding. This logic is unnecessary, the generic list rendering mechanism takes care of this, so removing this logic fixes the crash. We do have to make sure though that the column is really empty when there's no keybinding, so change the logic to use FgCyan only when there's a keybinding. |
||
---|---|---|
.. | ||
app | ||
cheatsheet | ||
commands | ||
common | ||
config | ||
constants | ||
env | ||
fakes | ||
gui | ||
i18n | ||
integration | ||
jsonschema | ||
logs | ||
snake | ||
tasks | ||
theme | ||
updates | ||
utils |