jesseduffield.lazygit/pkg
Stefan Haller ff4ae4a544 Fix possible crash when deleting a branch while filtering is active
The code that tries to reselect the same branch again uses GetItems, which in
case of filtering is the filtered list. After replacing the branches slice with
a new one, the filtered list is no longer up to date, so we must reapply the
filter before working with it. It so happens that refreshView does that, so
simply call that before setting the selection again; I don't think the order
matters in this case. Otherwise we'd have to insert another call to
ReApplyFilter before the call to GetItems, which we can avoid this way.

Note that this doesn't actually make anything work better in the case of
deleting a branch, since we can't reselect the deleted branch anyway of course.
But it avoids a possible crash if the branch that was deleted was the last one
in the unfiltered list.
2025-02-07 09:34:25 +01:00
..
app Add screen-mode command line argument 2025-01-02 16:01:48 +11:00
cheatsheet Initialize translation set after reading user config 2024-08-18 10:24:52 +02:00
commands Allow user to filter the files view to only show untracked files 2025-02-07 09:04:55 +11:00
common Make common.UserConfig an atomic.Pointer for safe concurrent access 2024-08-18 10:24:52 +02:00
config Improve error reporting on config migration 2025-01-30 09:01:17 +01:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes cleanup integration test code 2023-02-26 12:54:13 +11:00
gui Fix possible crash when deleting a branch while filtering is active 2025-02-07 09:34:25 +01:00
i18n Show filter state in top right corner of Files panel frame 2025-02-07 09:24:24 +01:00
integration Fix possible crash when deleting a branch while filtering is active 2025-02-07 09:34:25 +01:00
jsonschema Let schema/config.json end with a line feed 2024-11-30 15:03:29 +01:00
logs Remove secureexec package 2023-07-30 19:59:51 +10:00
snake integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
tasks Use ScanLinesAndTruncateWhenLongerThanBuffer instead of bufio.ScanLines 2024-05-15 13:27:01 +02:00
theme Highlight inactive selection in bold 2024-06-23 14:43:13 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Only avoid the blank line at end of view if view is not editable 2025-01-20 17:52:53 +01:00