Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions gitk-git/gitk
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ proc makewindow {} {
global diffcontextstring diffcontext
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Johannes Sixt wrote (reply to this):

Am 09.12.24 um 19:08 schrieb Christoph Sommer via GitGitGadget:
> From: Christoph Sommer <[email protected]>
> 
> Add a new preference "wrapdefault" which allows enabling char/word wrap.
> Impacts all text in the ctext widget for which no other preference exists.
> 
> Also make the (existing) preference "wrapcomment" configurable graphically.
> Its setting impacts only the "comment" part of the ctext widget.

Nice! I agree that it makes sense to wrap the comment differently than
the patch text section. I notice, though, that the patch text wrapping
is also applied to the commit header section. Personally, I don't mind
it. If someone needs a third option, they can take this patch as a
blueprint.

-- Hannes

global ignorespace
global maincursor textcursor curtextcursor
global rowctxmenu fakerowmenu mergemax wrapcomment
global rowctxmenu fakerowmenu mergemax wrapcomment wrapdefault
global highlight_files gdttype
global searchstring sstring
global bgcolor fgcolor bglist fglist diffcolors diffbgcolors selectbgcolor
Expand Down Expand Up @@ -2431,7 +2431,7 @@ proc makewindow {} {
set ctext .bleft.bottom.ctext
text $ctext -background $bgcolor -foreground $fgcolor \
-state disabled -undo 0 -font textfont \
-yscrollcommand scrolltext -wrap none \
-yscrollcommand scrolltext -wrap $wrapdefault \
-xscrollcommand ".bleft.bottom.sbhorizontal set"
if {$have_tk85} {
$ctext conf -tabstyle wordprocessor
Expand Down Expand Up @@ -11576,12 +11576,12 @@ proc create_prefs_page {w} {

proc prefspage_general {notebook} {
global NS maxwidth maxgraphpct showneartags showlocalchanges
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
global tabstop wrapcomment wrapdefault limitdiffs autoselect autosellen extdifftool perfile_attrs
global hideremotes want_ttk have_ttk maxrefs web_browser

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Johannes Sixt wrote (reply to this):

Am 09.12.24 um 19:08 schrieb Christoph Sommer via GitGitGadget:
> From: Christoph Sommer <[email protected]>
> 
> Make preference groups like "Diff display options" stand out more.

This is a nice and obvious improvement.

-- Hannes

set page [create_prefs_page $notebook.general]

${NS}::label $page.ldisp -text [mc "Commit list display options"]
${NS}::label $page.ldisp -text [mc "Commit list display options"] -font mainfontbold
grid $page.ldisp - -sticky w -pady 10
${NS}::label $page.spacer -text " "
${NS}::label $page.maxwidthl -text [mc "Maximum graph width (lines)"]
Expand All @@ -11602,11 +11602,22 @@ proc prefspage_general {notebook} {
-variable hideremotes
grid x $page.hideremotes -sticky w

${NS}::label $page.ddisp -text [mc "Diff display options"]
${NS}::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold
grid $page.ddisp - -sticky w -pady 10
${NS}::label $page.tabstopl -text [mc "Tab spacing"]
spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $page.tabstopl $page.tabstop -sticky w

${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"]
${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \
-textvariable wrapcomment
grid x $page.wrapcommentl $page.wrapcomment -sticky w

${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"]
${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \
-textvariable wrapdefault
grid x $page.wrapdefaultl $page.wrapdefault -sticky w

${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \
-variable showneartags
grid x $page.ntag -sticky w
Expand Down Expand Up @@ -11635,7 +11646,7 @@ proc prefspage_general {notebook} {
pack configure $page.webbrowserf.l -padx 10
grid x $page.webbrowserf $page.webbrowser -sticky ew

${NS}::label $page.lgen -text [mc "General options"]
${NS}::label $page.lgen -text [mc "General options"] -font mainfontbold
grid $page.lgen - -sticky w -pady 10
${NS}::checkbutton $page.want_ttk -variable want_ttk \
-text [mc "Use themed widgets"]
Expand All @@ -11654,7 +11665,7 @@ proc prefspage_colors {notebook} {

set page [create_prefs_page $notebook.colors]

${NS}::label $page.cdisp -text [mc "Colors: press to choose"]
${NS}::label $page.cdisp -text [mc "Colors: press to choose"] -font mainfontbold
grid $page.cdisp - -sticky w -pady 10
label $page.ui -padx 40 -relief sunk -background $uicolor
${NS}::button $page.uibut -text [mc "Interface"] \
Expand Down Expand Up @@ -11712,7 +11723,7 @@ proc prefspage_colors {notebook} {
proc prefspage_fonts {notebook} {
global NS
set page [create_prefs_page $notebook.fonts]
${NS}::label $page.cfont -text [mc "Fonts: press to choose"]
${NS}::label $page.cfont -text [mc "Fonts: press to choose"] -font mainfontbold
grid $page.cfont - -sticky w -pady 10
mkfontdisp mainfont $page [mc "Main font"]
mkfontdisp textfont $page [mc "Diff display font"]
Expand All @@ -11725,7 +11736,7 @@ proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
global hideremotes want_ttk have_ttk
global hideremotes want_ttk have_ttk wrapcomment wrapdefault

set top .gitkprefs
set prefstop $top
Expand All @@ -11734,7 +11745,7 @@ proc doprefs {} {
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
set oldprefs($v) [set $v]
}
ttk_toplevel $top
Expand Down Expand Up @@ -11860,7 +11871,7 @@ proc prefscan {} {
global oldprefs prefstop

foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
global $v
set $v $oldprefs($v)
}
Expand All @@ -11874,7 +11885,8 @@ proc prefsok {} {
global oldprefs prefstop showneartags showlocalchanges
global fontpref mainfont textfont uifont
global limitdiffs treediffs perfile_attrs
global hideremotes
global hideremotes wrapcomment wrapdefault
global ctext

catch {destroy $prefstop}
unset prefstop
Expand Down Expand Up @@ -11923,6 +11935,12 @@ proc prefsok {} {
if {$hideremotes != $oldprefs(hideremotes)} {
rereadrefs
}
if {$wrapcomment != $oldprefs(wrapcomment)} {
$ctext tag conf comment -wrap $wrapcomment
}
if {$wrapdefault != $oldprefs(wrapdefault)} {
$ctext configure -wrap $wrapdefault
}
}

proc formatdate {d} {
Expand Down Expand Up @@ -12392,6 +12410,7 @@ set downarrowlen 5
set mingaplen 100
set cmitmode "patch"
set wrapcomment "none"
set wrapdefault "none"
set showneartags 1
set hideremotes 0
set maxrefs 20
Expand Down Expand Up @@ -12497,7 +12516,7 @@ config_check_tmp_exists 50

set config_variables {
mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs
cmitmode wrapcomment wrapdefault autoselect autosellen showneartags maxrefs visiblerefs
hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
Expand Down
Loading