Code

git-gui: Add keyboard shortcuts for search and goto commands in blame view.
authorDavid Fries <david@fries.net>
Sat, 16 Jul 2011 16:59:45 +0000 (11:59 -0500)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 19 Jul 2011 14:31:29 +0000 (15:31 +0100)
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>
lib/blame.tcl
lib/search.tcl

index 14fde81761315aa67363fa549d78a56413f86069..bc81e29b4399a1fcb7d651d247528162229b4eda 100644 (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] }
 
index 7fdbf87bcdcf3e6d5a928dd4ac8a323509ea7953..ef3486f083c74f7f5e5fe9af861818ed0d64e89c 100644 (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 {} {
        }
 }
 
-}
\ No newline at end of file
+}