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

Feature Request: Ability to add comments into help view. #809

Open
MironVeryanskiy opened this issue Apr 6, 2018 · 0 comments
Open

Feature Request: Ability to add comments into help view. #809

MironVeryanskiy opened this issue Apr 6, 2018 · 0 comments

Comments

@MironVeryanskiy
Copy link

Feature Request : Ability to add comments into the help view.

Reason: There is no way to provide comments for custom keybinds in the help view.

image

Attempt: I tried to add hacky comments using shell in-line execution, but the # character still gets exposed to .tigrc parser, and stripped away.

image

stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 12, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied a bind command option,
      and add it to the head of the argv list, so that it is available to the option_bind_command().
      The #comment text string is trimmed of any white space.

   b. option_bind_command()

      Since comment text string is arg[0], the function needs to treat the argv list elements as shifted by one.
      When calling add_run_request(), pass in argv[0] as an extra argument.

3. keys.c

   a. add_run_request()

      A help text string is passed in as an extra argument;
      duplicate it into the new run_request.help field.

4. help.c

   a. help_draw()

      Analogous to drawing req_info.help as a LINE_DEFAULT,
      draw the run_request.help text using draw_text().
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 15, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied a bind command option,
      and add it to the head of the argv list (argv[0]),
      so that it is available to the option_bind_command() when it is eventually called.
      The #comment text string is trimmed of any white space.

   b. option_bind_command()

      Since argv[0] is now a container for a possible comment text string,
      the function needs to treat the argv list elements as shifted by one.
      When calling add_run_request(), pass in argv[0] as an extra argument.

   c. set_repo_config_option()

      option_bind_command() is directly called to handle keybindings defined in a repo configuration file.
      argv[0] must be prepared similarly to read_option(). However, argv[0] is set to an empty string,
      because comment text is never available from a repo configuration file.

3. keys.c

   a. add_run_request()

      A help text string is passed in as an extra argument;
      it is duplicated into the new run_request.help field.

4. help.c

   a. help_draw()

      Analogous to drawing req_info.help as a LINE_DEFAULT,
      draw the run_request.help text using draw_text(),
      even though it will be misaligned with existing help text.
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 17, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied a bind command option,
      and add it to the head of the argv list (argv[0]),
      so that it is available to the option_bind_command() when it is eventually called.
      The #comment text string is trimmed of any white space.

   b. option_bind_command()

      Since argv[0] is now a container for a possible comment text string,
      the function needs to treat the argv list elements as shifted by one.
      When calling add_run_request(), pass in argv[0] as an extra argument.

   c. set_repo_config_option()

      option_bind_command() is directly called to handle keybindings defined in a repo configuration file.
      argv[0] must be prepared similarly to read_option(). However, argv[0] is set to an empty string,
      because comment text is never available from a repo configuration file.

3. keys.c

   a. add_run_request()

      A help text string is passed in as an extra argument;
      it is duplicated into the new run_request.help field.

4. help.c

   a. help_draw()

      Analogous to drawing req_info.help as a LINE_DEFAULT,
      draw the run_request.help text using draw_text(),
      even though it will be misaligned with existing help text.
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 17, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied a bind command option,
      and add it to the head of the argv list (argv[0]),
      so that it is available to the option_bind_command() when it is eventually called.
      The #comment text string is trimmed of any white space.

   b. option_bind_command()

      Since argv[0] is now a container for a possible comment text string,
      the function needs to treat the argv list elements as shifted by one.
      When calling add_run_request(), pass in argv[0] as an extra argument.

   c. set_repo_config_option()

      option_bind_command() is directly called to handle keybindings defined in a repo configuration file.
      argv[0] must be prepared similarly to read_option(). However, argv[0] is set to an empty string,
      because comment text is never available from a repo configuration file.

3. keys.c

   a. add_run_request()

      A help text string is passed in as an extra argument;
      it is duplicated into the new run_request.help field.

4. help.c

   a. help_draw()

      Analogous to drawing req_info.help as a LINE_DEFAULT,
      draw the run_request.help text using draw_text(),
      even though it will be misaligned with existing help text.
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 19, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied a bind command option,
      and add it to the head of the argv list (argv[0]),
      so that it is available to the option_bind_command() when it is eventually called.
      The #comment text string is trimmed of any white space.

   b. option_bind_command()

      Since argv[0] is now a container for a possible comment text string,
      the function needs to treat the argv list elements as shifted by one.
      When calling add_run_request(), pass in argv[0] as an extra argument.

   c. set_repo_config_option()

      option_bind_command() is directly called to handle keybindings defined in a repo configuration file.
      argv[0] must be prepared similarly to read_option(). However, argv[0] is set to an empty string,
      because comment text is never available from a repo configuration file.

3. prompt.c

      option_bind_command() is eventually called to handle keybindings defined in a prompt line.
      argv[0] must be prepared similarly to read_option(). However, argv[0] is set to an empty string,
      because comment text is not parsed on a prompt line.

4. keys.c

   a. add_run_request()

      A help text string is passed in as an extra argument;
      it is duplicated into the new run_request.help field.

5. help.c

   a. help_draw()

      Analogous to drawing req_info.help as a LINE_DEFAULT,
      draw the run_request.help text using draw_text(),
      even though it will be misaligned with existing help text.
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 20, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.h

   Add a parameter to set_option() for passing any comment text.

3. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied an option command,
      and pass it into set_option(). The #comment text string is trimmed of any white space.

   b. set_option()

      set_option() dispatches to specific bind commands.
      Pass any given comment text into the option_bind_command(),
      and ignore comment text for the other bind commands.

   c. option_bind_command()

      Pass comment text into add_run_request().

   d. read_repo_config_option()

      Specify the option command to use with "color", "bind", or "set" names
      instead of specific function names.

   e. set_repo_config_option()

      Refactor to call set_option(), the dispatcher for specific bind commands,
      and call with comment text pointer set to NULL,
      because comment text is never available from a repo configuration file.

4. prompt.c

   a. run_prompt_command()

      Call set_option() with comment text pointer set to NULL,
      because comment text is not parsed on a prompt line.

5. keys.c

   a. add_run_request()

      Duplicate comment text into the new run_request.help field.

6. help.c

   a. help_draw()

      Draw the run_request.help text using draw_text(), analogous to drawing req_info.help.
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue May 31, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.h

   Add a parameter to set_option() for passing any comment text.

3. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied an option command,
      and pass it into set_option(). The #comment text string is trimmed of any white space.

   b. set_option()

      set_option() dispatches to specific bind commands.
      Pass any given comment text into the option_bind_command(),
      and ignore comment text for the other bind commands.

   c. option_bind_command()

      Pass comment text into add_run_request().

   d. read_repo_config_option()

      Specify the option command to use with "color", "bind", or "set" names
      instead of specific function names.

   e. set_repo_config_option()

      Refactor to call set_option(), the dispatcher for specific bind commands,
      and call with comment text pointer set to NULL,
      because comment text is never available from a repo configuration file.

4. prompt.c

   a. run_prompt_command()

      Call set_option() with comment text pointer set to NULL,
      because comment text is not parsed on a prompt line.

5. keys.c

   a. add_run_request()

      Duplicate comment text into the new run_request.help field.

6. help.c

   a. help_draw()

      Draw the run_request.help text using draw_text(), analogous to drawing req_info.help.
stevenyvr987 added a commit to stevenyvr987/tig that referenced this issue Jul 27, 2019
1. keys.h

   Add a run_request.help field, analogous to the req_info.help field.

2. options.h

   Add a parameter to set_option() for passing any comment text.

3. options.c

   a. read_option()

      Identify any #comment text string that may have accompanied an option command,
      and pass it into set_option(). The #comment text string is trimmed of any white space.

   b. set_option()

      set_option() dispatches to specific bind commands.
      Pass any given comment text into the option_bind_command(),
      and ignore comment text for the other bind commands.

   c. option_bind_command()

      Pass comment text into add_run_request().

   d. read_repo_config_option()

      Specify the option command to use with "color", "bind", or "set" names
      instead of specific function names.

   e. set_repo_config_option()

      Refactor to call set_option(), the dispatcher for specific bind commands,
      and call with comment text pointer set to NULL,
      because comment text is never available from a repo configuration file.

4. prompt.c

   a. run_prompt_command()

      Call set_option() with comment text pointer set to NULL,
      because comment text is not parsed on a prompt line.

5. keys.c

   a. add_run_request()

      Duplicate comment text into the new run_request.help field.

6. help.c

   a. help_draw()

      Draw the run_request.help text using draw_text(), analogous to drawing req_info.help.
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

1 participant