Skip to content

Show [0] keybinding in main view title #4754

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

Show the [0] keybinding in the title of the main view, to make it more discoverable.

Also, move it to the "global" section of the keybindings menu.

And several minor fixes and cleanups, see individual commits for details.

Fixes #4738.

This is not a behavior change, we already include these in the menu, but that's
because of a bug that we will fix in the next commit.

I find it useful to see these commands, especially for rarely-used custom
commands that you don't want to waste a keybinding on.
It previously returned "\x00", which is probably not intended, but happened to
work.
I left this out originally because it's not needed for the status "dashboard"
view (except on really tiny screens); however, it *is* useful after pressing `a`
to show the all branches log, and even more so for people who use the
"statusPanelView: allBranchesLog" config. And it doesn't really hurt for the
dashboard view either, so just enable it always rather than making a distinction
which view we are showing.
…n view title prefix

We show it only if the "showPanelJumps" config is on, although the
focus-main-view command is not technically part of the panel jump keys; but it
looks similar.
@stefanhaller stefanhaller added the enhancement New feature or request label Jul 19, 2025
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 143d4761 64.71%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (143d476) Report Missing Report Missing Report Missing
Head commit (84a84df) 56869 49334 86.75%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4754) 17 11 64.71%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Comment on lines +208 to +213
keyToTitlePrefix := func(key string) string {
if key == "<disabled>" {
return ""
}
return fmt.Sprintf("[%s]", key)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix display of panel jump keys for disabled bindings
- commit subject

hi!

this handles the corresponding in this section from config docs, right?

lazygit/docs/Config.md

Lines 963 to 969 in 143d476

You can disable certain key bindings by specifying `<disabled>`.
```yaml
keybinding:
universal:
edit: <disabled> # disable 'edit file'
```

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@goyalyashpal
Copy link

goyalyashpal commented Jul 19, 2025

  • it's nice to see tabs used here for indentation.
  • ... which is otherwise demonised everywhere else, i don't know why.
    i think people demonise it just 'cz their favourite editor (or the whole editor world) is hesistant to up their game for its handling (editing, rendering, etc).

tab (or tabular space / tabulation) character is:

  • easy to parse (single char per depth)
    no need to handle ambiguous cases, language injections (in markup code blocks) etc. - it's always just a single tab per level
  • trivial to implement "change display size" in logic
    whether editor wants to show it as typical 4, wide 8, narrow 2 or even 1: no edits to source is required.
    doing that for space-indents is such a pain

same goes for sentence-breaks in prose:

  • it makes parsing for sentences so much easier.
  • ... both programatically, visually, and even for src-quoting purposes.
  • but still, it's used/supported by very few things
  • what more, this markdown rendering eats/collapses all of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put [0] shortcut number at header of main view too
2 participants