Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when filtering the keybindings menu #3450

Merged
merged 1 commit into from
Mar 28, 2024

Commits on Mar 28, 2024

  1. Fix crash when filtering the keybindings menu

    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.
    stefanhaller committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    0b70dfb View commit details
    Browse the repository at this point in the history