jesseduffield.lazygit/pkg/gui/controllers/helpers
Stefan Haller bd8518355e Keep the same commit selected when exiting filtering mode
When exiting filtering mode, we currently keep the selection index the same in
the commits panel. This doesn't make sense at all, since the index in the
filtered view has no relation to the index in the unfiltered view.

I often use filtering mode (either by path or by author) to find a given commit
faster than I would otherwise be able to. When exiting filtering mode, it's
useful to keep the same commit selected, so that I can look at the surrounding
commits, see which branch it was a part of, etc. So reselect the commit again
after exiting filtering mode.

Sometimes this is not possible, most likely when the commit is so long ago that
it's outside of the initial 300 range. In that case, at least select the commit
again that was selected before I entered filtering; this is still better than
arbitrarily keeping the same selection index.
2024-03-28 12:23:46 +01:00
..
amend_helper.go Improve prompts when amending commits 2023-09-01 18:55:16 +02:00
app_status_helper.go Add ErrorToast function 2024-01-14 17:45:35 +01:00
bisect_helper.go split context common from helper common 2023-04-30 13:19:53 +10:00
branches_helper.go Allow deleting remote tags/branches from local tag/branch views (#2738) 2023-08-10 17:39:26 +10:00
cherry_pick_helper.go Cleanup: remove unused method 2024-02-10 11:05:09 +01:00
commits_helper.go Fix disabling the switch-to-editor menu item if unavailable 2024-03-18 21:10:58 +01:00
commits_helper_test.go Remove hard line breaks when rewording commits 2024-03-09 10:00:44 +01:00
confirmation_helper.go Make DisabledReason a struct 2024-01-14 17:45:35 +01:00
credentials_helper.go Handle pending actions properly in git commands that require credentials 2023-07-08 22:54:52 +10:00
diff_helper.go Move IgnoreWhitespaceInDiffView to AppState, and persist it when it changes 2023-07-31 11:41:55 +02:00
files_helper.go Support editing multiple files at once using range selection 2024-03-22 08:20:16 +01:00
fixup_helper.go Add SetSelection function for list contexts and use it in most places 2024-01-19 10:47:21 +11:00
gpg_helper.go Use an interface for tasks instead of a concrete struct 2023-07-10 17:12:21 +10:00
helpers.go Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
host_helper.go Obtain remote URL by calling "ls-remote --get-url" instead of using git config 2024-01-10 09:24:23 +01:00
inline_status_helper.go Fix inline status removal when recording demos 2024-03-23 20:45:51 +11:00
merge_and_rebase_helper.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
merge_conflicts_helper.go Standardise display of range selection across views 2024-01-19 10:47:21 +11:00
mode_helper.go Keep the same commit selected when exiting filtering mode 2024-03-28 12:23:46 +01:00
patch_building_helper.go Fix linter warnings 2024-03-02 10:09:32 +01:00
record_directory_helper.go split context common from helper common 2023-04-30 13:19:53 +10:00
refresh_helper.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
refs_helper.go Refresh after creating local branch, before checking it out 2024-03-17 07:53:38 +01:00
repos_helper.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
search_helper.go Default to substring filtering, add option to go back to fuzzy filtering 2024-03-17 11:55:09 +01:00
snake_helper.go split context common from helper common 2023-04-30 13:19:53 +10:00
staging_helper.go Don't pass ignoreWhitespace to git commands 2023-09-04 17:50:49 +02:00
sub_commits_helper.go Add author filtering to commit view 2024-02-21 09:58:09 +01:00
suggestions_helper.go Rename FuzzySearchFunc to FilterFunc 2024-03-17 11:56:29 +01:00
tags_helper.go Allow force-tagging if tag exists 2023-07-31 11:38:52 +02:00
update_helper.go Use an interface for tasks instead of a concrete struct 2023-07-10 17:12:21 +10:00
upstream_helper.go standardise helper args 2023-04-30 13:19:53 +10:00
upstream_helper_test.go Standardise on using lo for slice functions 2023-07-30 18:51:23 +10:00
view_helper.go standardise helper args 2023-04-30 13:19:53 +10:00
window_arrangement_helper.go Add config setting for side panel location (left or top) in half screen mode 2024-01-09 15:45:26 +01:00
window_arrangement_helper_test.go Add config setting for side panel location (left or top) in half screen mode 2024-01-09 15:45:26 +01:00
window_helper.go Fix main view refresh after adding the first file to a custom patch 2024-01-28 09:49:56 +01:00
working_tree_helper.go Extract a WithEnsureCommitableFiles function 2023-08-29 09:10:59 +02:00
worktree_helper.go Use fields rather than methods on worktrees 2023-07-30 18:35:24 +10:00