Skip to content

Commit 4adcbea

Browse files
stefanhallerpaulusmack
authored andcommitted
gitk: Make text selectable on Mac
Stolen from git-gui, 23effa7 (original log message by Shawn O. Pearce <[email protected]> follows): git-gui: Force focus to the diff viewer on mouse click. Apparently a "feature" of Tcl/Tk on Mac OS X is that a disabled text widget cannot receive focus or receive a selection within it. This makes the diff viewer almost useless on that platform as you cannot select individual parts of the buffer. Now we force focus into the diff viewer when its clicked on with button 1. This works around the feature and allows selection to work within the viewer just like it does on other less sane systems, like Microsoft Windows. Signed-off-by: Stefan Haller <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 120ea89 commit 4adcbea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gitk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,6 +2477,7 @@ proc makewindow {} {
24772477
global ctxbut
24782478
bind $cflist $ctxbut {pop_flist_menu %W %X %Y %x %y}
24792479
bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y}
2480+
bind $ctext <Button-1> {focus %W}
24802481

24812482
set maincursor [. cget -cursor]
24822483
set textcursor [$ctext cget -cursor]

0 commit comments

Comments
 (0)