-
Notifications
You must be signed in to change notification settings - Fork 612
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
diff-options and the ability to bind keys to tig prompt commands #116
Conversation
This is useful for persistent arguments to the diff view instead of setting TIG_DIFF_OPTS or always passing them on the command line invocation.
parse_args() is only used by option_set_command() for the two "argv" style options: blame-options and diff-options. Allowing parse_args() to overwrite the destination enables ":set diff-options = ..." to work more than once from within the tig prompt (or at all if first set via tigrc). This is safe since argv_copy() handles the necessary freeing, added as part of 7dfa0b2.
Preparation for running prompt commands from keybindings.
This allows new diff-options to take effect. The diff view is still unrefreshable when reading data from STDIN.
Redrawing is not always enough but is still used as a fallback if the view is unrefreshable.
A boolean return value limits the ability of open_run_request() to handle more complex run requests in the future. The "quit, refresh, or do nothing" logic in view_driver(), based on the boolean return value, is easily represented by returning REQ_QUIT, REQ_REFRESH, or REQ_NONE from open_run_request() itself. Returning a request also seems more in line with workings of other functions which process requests. The current view is passed to open_run_request(), which enables it to return REQ_REFRESH as appropriate. For the future, this also opens the door for other queries and actions on the view.
"Internal" run requests now provide a way to add keybindings for tigrc and tig prompt commands. For example: bind diff F :set diff-options = --full-diff Much of the change to open_run_request() is increased indentation; viewing the diff with whitespace ignored (git show -w or pressing W in tig) reveals the simplicity of the functional changes.
Thanks, all applied except the modeline patch. I prefer if you could add it to your ~/.vimrc instead. |
Thanks for merging! I included the modeline patch because contributors may not have the same |
The other option is |
The whitespace preferences are really project-wide, not just tig.c, but |
For some of the projects I have contributed to I've simply added a line like this to ~/.vimrc:
On the other hand, I want to keep the most active contributor to tig happy so I will add the mode lines. :) |
:) tig is fantastic, and I enjoy contributing. I use it everyday for On 02/20/2013 07:25 PM, Jonas Fonseca wrote:
|
This was originally suggested by Thomas Sibley to ease contributions. Use the update mechanism to add Copyright notice for 2013.
Adds support for the features described in GH #69.