Re: [PATCH 2/2] git-gui blame add more common search hotkeys
- From
Pat Thoyts <patthoyts@users.sourceforge.net>
- Date
- Jul 19, 2011, 14:35 UTC
- Message-ID
- <87sjq2cp8t.fsf@fox.patthoyts.tk>
- In-Reply-To
- <20110716165945.GA9722@spacedout.fries.net>
David Fries <david@fries.net> writes:
Show 7 quoted lines
>add slash and Control-S to bring up search >enter, n, Shift-Enter, Shift-n to to go the next and previous entries > >search hotkey return is find_next shift prev > >Signed-off-by: David Fries <David@Fries.net> >
Thank you for this. It looks like a useful feature and I'll apply this to git-gui with some modifications. Note that Paul Mackerras is the maintainer of gitk not git-gui.
It is worth putting a bit more detail into the commit message as in general that is all the context a maintainer has to decide what the patch is doing and how it should be tested. In this case I'll replace it with the following:
git-gui: Add keyboard shortcuts for search and goto commands in blame view.
Use forward-slash or Control-S to bring up the search dialog. In the blame view, Enter or 'n' jump to the next selected region while Shift-Enter or Shift-n will jump to the previous selected region. Within the search control, hitting Enter will now jump to the next matching region.
Signed-off-by: David Fries <David@Fries.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
That aside, the goto-line feature works fine for me. I don't think the n, Shift-n binding is working though. When I have the focus in the blame window and enter 'n' it tries to add an 'n' to the text in the search box. The use of Enter and Shift-Enter makes sense and works as I expect. So I will drop the 'n' and 'Shift-n' bindings I think.
The -accelerator field on a menu specifies the text to show. Its more usual to show "Ctrl-G" than "Control-Key-G" here so I'll adjust that as well. The 'bind' command actually ties up the key binding to the menu action.
With the above changes, I'll apply this to git-gui's master (which lives at repo.or.cz/git-gui.git) and it will get merged into git on the next merge.
Cheers, Pat Thoyts
-- Pat Thoyts http://www.patthoyts.tk/ PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD