Default the interactive header column prompt to the first column - #1158
Default the interactive header column prompt to the first column#1158ChrisJr404 wants to merge 1 commit into
Conversation
When the header_column command (default key Y) prompts for a value, confirming with an empty input now sets the header column to 1 instead of reporting an invalid number. Selecting the first column is by far the most common case, so it makes a sensible default and saves a keystroke. Refs noborus#740
|
Thank you for the proposal regarding ov. I agree that entering numbers in For users who always want the first column fixed in column mode, configuring the following is sufficient: General:
HeaderColumn: 1The same setting can also be specified for an individual view mode. Since HeaderColumn is already applied when the document is displayed in column mode, no additional behavior is required. With these workflows, Y remains useful for explicitly setting a different number of header columns. Therefore, an empty input to header_column should not implicitly set the value to 1; it should remain invalid as it is today. This keeps the meaning of Y explicit and avoids making an empty confirmation perform an unexpected change. |
This makes the interactive
header_columncommand (default keyY) default to the first column when confirmed with no input, so the common case no longer requires typing a value.As noted in #740,
header_columncurrently prompts for a number and reports "invalid number" if you just press Enter. In practice the value is almost always1(pin the first column as a vertical header), so requiring it to be typed every time is a small but constant bit of friction. With this change, confirming the prompt with an empty input sets the header column to1; any non-empty value is still parsed and validated exactly as before, and a non-numeric entry still reports an invalid number. Existing behavior for explicit values is unchanged.The change is scoped to
setHeaderColumn, which is only reached from the interactive prompt's confirm handler, so nothing else is affected.Testing: updated
TestRoot_setHeaderColumnso the empty-input case now expects1, and rango test ./...(all packages pass) plusgo vet ./oviewer/andgofmt.