Add default values to end of line and beginning of life key bindings#301
Conversation
utafrali
left a comment
There was a problem hiding this comment.
The change is correct and fills the gap that left BeginningOfLine and EndOfLine with zero-value bindings when no config file is present. Two minor consistency issues: field initialization order differs from the struct declaration, and the help text strings diverge from the equivalent strings in SetupKeybindings.
| key.WithKeys("G"), // Capital 'G' for shift+g | ||
| key.WithHelp("G", "go to bottom"), | ||
| ), | ||
| BeginningOfLine: key.NewBinding( |
There was a problem hiding this comment.
The initialization order here (BeginningOfLine before EndOfLine) is the reverse of the struct field declaration order in TUIKeyBindings (lines 58-59), where EndOfLine comes first. Keeping the same order in both places makes it easier to scan and compare the two.
| ), | ||
| BeginningOfLine: key.NewBinding( | ||
| key.WithKeys("0"), | ||
| key.WithHelp("0", "navigate all the way to the left of the table"), |
There was a problem hiding this comment.
The help text here ("navigate all the way to the left of the table") differs from the text used in pkg/config/config.go line 198 ("beginning of current line"). Same mismatch for EndOfLine: "navigate all the way to the right of the table" vs "end of current line". Since both paths produce a TUIKeyBindings that drives the same help display, the strings should match. Consider picking one phrasing and using it in both places.
Add default values to new keybindings