Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config option to disable switching tabs with panel jump keys (#3927)
# **PR Description** ## Problem this PR attempts to solve I really appreciate the feature added in #3794 that allows switching tabs using panel jump keys when the side panel is already active and see how it is convenient for many users. However, after using lazygit for quite some time, I've developed muscle memory where I rely on pressing a number key to instantly switch to a panel and perform an action, regardless of which panel is currently active. I have found myself several times in the past few days clicking '2' and going to hit 'a' + 'c' to commit all and find I was already had window 2 active and my tab was instead switched to 'Worktrees' and the keybindings no longer apply to stage or commit. ## Solution - Add a config `SwitchTabsWithPanelJumpKeys` as a gui boolean that is true by default, keeping the current new behavior added by #3794 - When `SwitchTabsWithPanelJumpKeys` is set to false in the user's config, the old behavior is returned which does not switch tabs using the side panel jump keys. - This is behavior is verified with an integration test with ``SwitchTabsWithPanelJumpKeys` set to false that shows the expected behavior that jumping to window 2 while window 2 is already active does not switch tabs within window 2 To disable switching tabs with panel jump keys, add the following to your config.yml: ```yaml gui: # If true, when using the panel jump keys (default 1 through 5) and target panel is already active, go to next tab instead switchTabsWithPanelJumpKeys: false ``` ### P.S. This is my first contribution to lazygit and while I absolutely strived to read all documentation and follow all standards, I accept that this PR may not be perfect and am very open to feedback and suggestions to improve both this code and any future contributions. I absolutely love lazygit, I use it everyday and swear by it as the most powerful and efficient tool for managing git, I love and appreciate all the work all the maintainers do to constantly improve it. So thank you to all who are reading this and I look forward to contributing more to make lazygit even more of the best git tool available! * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] No text rendered to user -> Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [x] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
- Loading branch information