1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-24 08:52:21 +02:00
lazygit/pkg/gui
Stefan Haller 0b70dfbf46 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.
2024-03-28 09:58:45 +01:00
..
context Fix crash when filtering the keybindings menu 2024-03-28 09:58:45 +01:00
controllers Fix inline status removal when recording demos 2024-03-23 20:45:51 +11:00
filetree Support selecting file range in patch builder 2024-01-28 12:00:47 +11:00
keybindings Add range selection ability on list contexts 2024-01-19 10:47:21 +11:00
mergeconflicts Standardise display of range selection across views 2024-01-19 10:47:21 +11:00
modes Add author filtering to commit view 2024-02-21 09:58:09 +01:00
patch_exploring Make range selections created with the mouse non-sticky 2024-01-24 08:22:55 +01:00
popup Add ErrorToast function 2024-01-14 17:45:35 +01:00
presentation Show inline waiting status when checking out a local branch 2024-03-17 07:53:38 +01:00
services/custom_commands Standardise on using lo for slice functions 2023-07-30 18:51:23 +10:00
status Double the duration of error toasts 2024-01-14 17:45:35 +01:00
style Stop hiding underscores for VSCode 2023-06-01 20:12:20 +10:00
types Default to substring filtering, add option to go back to fuzzy filtering 2024-03-17 11:55:09 +01:00
background.go Ensure background refreshes don't bunch up 2023-07-10 17:30:44 +10:00
command_log_panel.go Introduce filtered list view model 2023-07-03 12:54:13 +10:00
context_config.go move some methods 2023-04-30 13:19:53 +10:00
context.go Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
controllers.go Save and restore the unwrapped description 2024-03-09 10:00:44 +01:00
dummies.go Make it possible to handle toasts in integration tests 2024-01-14 17:42:03 +01:00
editors.go Add emacs-keybinds for word navigation 2023-08-15 12:22:17 +02:00
extras_panel.go Extract a SaveAppStateAndLogError function 2023-09-04 17:50:49 +02:00
global_handlers.go Add config to truncate commit hashes when copying them to the clipboard 2024-03-22 09:58:54 +01:00
gui_common.go Add WithInlineStatus helper function 2023-10-08 18:45:36 +02:00
gui_driver.go Show unacknowledged toast message upon integration test failure 2024-01-19 10:50:49 +11:00
gui.go Always prompt to return from subprocess if there was an error 2024-03-21 14:17:10 +01:00
information_panel.go If OpenLink errors, show a dialog instead 2023-08-09 13:12:40 +01:00
keybindings.go Add config to truncate commit hashes when copying them to the clipboard 2024-03-22 09:58:54 +01:00
layout.go Show popup message with breaking changes on startup 2024-03-12 13:27:14 +01:00
main_panels.go Fix main view refresh after adding the first file to a custom patch 2024-01-28 09:49:56 +01:00
menu_panel.go Add SetSelection function for list contexts and use it in most places 2024-01-19 10:47:21 +11:00
options_map.go Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
pty_windows.go Format code to pass lint 2021-09-16 21:38:43 +08:00
pty.go Set the TERM env variable 2024-03-23 23:46:37 +01:00
recent_repos_panel.go Use forward-slashes on windows 2023-07-30 18:35:24 +10:00
tasks_adapter.go Use an interface for tasks instead of a concrete struct 2023-07-10 17:12:21 +10:00
test_mode.go Add ErrorToast function 2024-01-14 17:45:35 +01:00
view_helpers.go Fix number of lines to read from a task initially for the right scroll bar size 2024-02-16 13:48:27 +01:00
views.go Add config for soft-wrapping the commit message body 2024-03-09 10:00:44 +01:00