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>
This commit is contained in:
David Fries 2011-07-16 11:59:45 -05:00 committed by Pat Thoyts
parent 9a483e5c09
commit af9a4625fa
2 changed files with 7 additions and 1 deletions

View File

@ -352,9 +352,13 @@ constructor new {i_commit i_path i_jump} {
bind $w_cviewer <Button-1> [list focus $w_cviewer]
bind $w_file <Visibility> [cb _focus_search $w_file]
bind $top <F7> [list searchbar::show $finder]
bind $top <Key-slash> [list searchbar::show $finder]
bind $top <Control-Key-s> [list searchbar::show $finder]
bind $top <Escape> [list searchbar::hide $finder]
bind $top <F3> [list searchbar::find_next $finder]
bind $top <Key-n> [list searchbar::find_next $finder]
bind $top <Shift-F3> [list searchbar::find_prev $finder]
bind $top <Shift-Key-n> [list searchbar::find_prev $finder]
bind $top <Control-Key-g> [list linebar::show $gotoline]
catch { bind $top <Shift-Key-XF86_Switch_VT_3> [list searchbar::find_prev $finder] }

View File

@ -35,6 +35,8 @@ constructor new {i_w i_text args} {
grid remove $w
trace add variable searchstring write [cb _incrsearch_cb]
bind $w.ent <Return> [cb find_next]
bind $w.ent <Shift-Return> [cb find_prev]
bind $w <Destroy> [list delete_this $this]
return $this
@ -196,4 +198,4 @@ method scrolled {} {
}
}
}
}