Code

git-gui: drop the 'n' and 'Shift-n' bindings from the last patch.
[git.git] / lib / blame.tcl
index 61e358f960ca949cac5664c67442b82d0afca65f..2099776f12ebb4f8e0fba754809d43ca7972dd56 100644 (file)
@@ -22,6 +22,7 @@ field w_asim     ; # text column: annotations (simple computation)
 field w_file     ; # text column: actual file data
 field w_cviewer  ; # pane showing commit message
 field finder     ; # find mini-dialog frame
+field gotoline   ; # line goto mini-dialog frame
 field status     ; # status mega-widget instance
 field old_height ; # last known height of $w.file_pane
 
@@ -231,6 +232,11 @@ constructor new {i_commit i_path i_jump} {
                -column [expr {[llength $w_columns] - 1}] \
                ]
 
+       set gotoline [::linebar::new \
+               $w.file_pane.out.lf $w_file \
+               -column [expr {[llength $w_columns] - 1}] \
+               ]
+
        set w_cviewer $w.file_pane.cm.t
        text $w_cviewer \
                -background white \
@@ -275,6 +281,10 @@ constructor new {i_commit i_path i_jump} {
                -label [mc "Find Text..."] \
                -accelerator F7 \
                -command [list searchbar::show $finder]
+       $w.ctxm add command \
+               -label [mc "Goto Line..."] \
+               -accelerator "Ctrl-G" \
+               -command [list linebar::show $gotoline]
        menu $w.ctxm.enc
        build_encoding_menu $w.ctxm.enc [cb _setencoding]
        $w.ctxm add cascade \
@@ -342,9 +352,12 @@ 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       <Shift-F3>   [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] }
 
        grid configure $w.header -sticky ew
@@ -1298,9 +1311,9 @@ method _position_tooltip {} {
        set pos_y [expr {[winfo pointery .] + 10}]
 
        set g "${req_w}x${req_h}"
-       if {$pos_x >= 0} {append g +}
+       if {[tk windowingsystem] eq "win32" || $pos_x >= 0} {append g +}
        append g $pos_x
-       if {$pos_y >= 0} {append g +}
+       if {[tk windowingsystem] eq "win32" || $pos_y >= 0} {append g +}
        append g $pos_y
 
        wm geometry $tooltip_wm $g