@matheusbsbs / matheus-bagliano / commits / 21ac8a8d0b
Fork 0

gitk: Allow user to control how much of the SHA1 ID gets auto-selected

This adds a new spinbox on the Edit Preferences pane to allow the user to control how many characters of the SHA1 ID get autoselected. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Mar 9, 2011 at 20:52 UTC 21ac8a8d0b8d95058e8fc7121ab7e653ab948c9e
1 file changed +9 -6
gitk
+9 -6
@@ -2652,7 +2652,7 @@ proc savestuff {w} {
2652 global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
2653 global cmitmode wrapcomment datetimeformat limitdiffs
2654 global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
2655 - global autoselect extdifftool perfile_attrs markbgcolor use_ttk
2655 + global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
2656 global hideremotes want_ttk
2657
2658 if {$stuffsaved} return
@@ -2673,6 +2673,7 @@ proc savestuff {w} {
2673 puts $f [list set cmitmode $cmitmode]
2674 puts $f [list set wrapcomment $wrapcomment]
2675 puts $f [list set autoselect $autoselect]
2676 + puts $f [list set autosellen $autosellen]
2677 puts $f [list set showneartags $showneartags]
2678 puts $f [list set hideremotes $hideremotes]
2679 puts $f [list set showlocalchanges $showlocalchanges]
@@ -6896,7 +6897,7 @@ proc selectline {l isnew {desired_loc {}}} {
6897 global mergemax numcommits pending_select
6898 global cmitmode showneartags allcommits
6899 global targetrow targetid lastscrollrows
6899 - global autoselect jump_to_here
6900 + global autoselect autosellen jump_to_here
6901
6902 catch {unset pending_select}
6903 $canv delete hover
@@ -6958,7 +6959,7 @@ proc selectline {l isnew {desired_loc {}}} {
6959 $sha1entry delete 0 end
6960 $sha1entry insert 0 $id
6961 if {$autoselect} {
6961 - $sha1entry selection range 0 end
6962 + $sha1entry selection range 0 $autosellen
6963 }
6964 rhighlight_sel $id
6965
@@ -10756,7 +10757,7 @@ proc doprefs {} {
10757 global maxwidth maxgraphpct use_ttk NS
10758 global oldprefs prefstop showneartags showlocalchanges
10759 global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
10759 - global tabstop limitdiffs autoselect extdifftool perfile_attrs
10760 + global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
10761 global hideremotes want_ttk have_ttk
10762
10763 set top .gitkprefs
@@ -10784,9 +10785,10 @@ proc doprefs {} {
10785 ${NS}::checkbutton $top.showlocal -text [mc "Show local changes"] \
10786 -variable showlocalchanges
10787 grid x $top.showlocal -sticky w
10787 - ${NS}::checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
10788 + ${NS}::checkbutton $top.autoselect -text [mc "Auto-select SHA1 (length)"] \
10789 -variable autoselect
10789 - grid x $top.autoselect -sticky w
10790 + spinbox $top.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
10791 + grid x $top.autoselect $top.autosellen -sticky w
10792 ${NS}::checkbutton $top.hideremotes -text [mc "Hide remote refs"] \
10793 -variable hideremotes
10794 grid x $top.hideremotes -sticky w
@@ -11428,6 +11430,7 @@ set showlocalchanges 1
11430 set limitdiffs 1
11431 set datetimeformat "%Y-%m-%d %H:%M:%S"
11432 set autoselect 1
11433 +set autosellen 40
11434 set perfile_attrs 0
11435 set want_ttk 1
11436