Skip to content
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

Confusing commit-title-graph option #879

Closed
andreas-gruenbacher opened this issue Dec 10, 2018 · 1 comment
Closed

Confusing commit-title-graph option #879

andreas-gruenbacher opened this issue Dec 10, 2018 · 1 comment

Comments

@andreas-gruenbacher
Copy link

The commit-title-graph option is somewhat confusing: when switching the way how graphs are rendered with ':toggle commit-title-graph' or with the default bindings, 'G', the new setting is shown as 'set commit-title-graph = v1' and similar in the status line. However, the command ':set commit-title-graph = v1' doesn't work ('Unknown option name: commit-title-graph'). Instead, 'set main-view-commit-title-graph = v1' must be used as a command or in config file. This also isn't obvious from the documentation.

@stevenyvr987
Copy link
Contributor

stevenyvr987 commented Jul 6, 2019

I also find it confusing between what is shown and what needs to be typed on the prompt line. The confusion is the same for any toggle option. A toggle option should be prefixed by a view name to be well-defined. The documentation mentions it in the 3rd paragraph of View settings of the man page tigrc:

Specifications can also be given for a single column, for example to override the defaults in the system tigrc file. To override a single column, use the column name as a suffix after the view setting name, e.g. main-view-date will allow to set the date in the main view.

The code for showing a new setting is in the function prompt_toggle_option(). It could be modified to show, for example, :set main-view-commit-title-graph = v1 instead of set commit-title-graph = v1. I suggest including a colon so that what is shown mimics exactly what needs to be typed on the prompt line. I'll submit a PR for this effect.

stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue Jul 8, 2019
Whenever a view column option is toggled, the new setting is echoed on the status line, but it does not mimic what should be typed on the status line using the set command to achieve the same thing.

For example, the message 'set commit-title-graph = v1' is shown but the user needs to type ':set main-view-commit-title-graph = v1' on the status line to achieve the same setting, ie, the user needs to type colon to initiate prompt mode, and then type the view name as a prefix to the option name.

The PR modifies prompt_toggle_option() to show exactly what needs to be typed on the status line. The function called success() with a format string, an option name, and an option value to generate a status line for each type of option value. The format string is modified to include view->name as a prefix to option name. A macro wrapper for success() is used to reduce repetition.

Fixes issue jonas#879.
koutcher pushed a commit that referenced this issue Nov 6, 2019
Whenever a view column option is toggled, the new setting is echoed on the status line, but it does not mimic what should be typed on the status line using the set command to achieve the same thing.

For example, the message 'set commit-title-graph = v1' is shown but the user needs to type ':set main-view-commit-title-graph = v1' on the status line to achieve the same setting, ie, the user needs to type colon to initiate prompt mode, and then type the view name as a prefix to the option name.

The PR modifies prompt_toggle_option() to show exactly what needs to be typed on the status line. The function called success() with a format string, an option name, and an option value to generate a status line for each type of option value. The format string is modified to include view->name as a prefix to option name. A macro wrapper for success() is used to reduce repetition.

Fixes issue #879.
@koutcher koutcher closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants