diff options
| author | Jiang Xin <worldhello.net@gmail.com> | 2020-12-21 07:10:19 +0800 |
|---|---|---|
| committer | Jiang Xin <worldhello.net@gmail.com> | 2020-12-21 07:10:19 +0800 |
| commit | 3104153d5ea3bd0e68166e02ec847a895f9a76e6 (patch) | |
| tree | 8b65383c203c550fab3f6ffea51cd474168ac34b /git-gui/git-gui.sh | |
| parent | da5bf7b515cb61535f413b2a44aa33248091f286 (diff) | |
| parent | 6d3ef5b467eccd2769f1aa1c555d317d3c8dc707 (diff) | |
| download | git-3104153d5ea3bd0e68166e02ec847a895f9a76e6.tar.xz | |
Merge remote-tracking branch 'github/master' into git-po-master
* github/master: (42 commits)
Git 2.30-rc1
git-gui: use gray background for inactive text widgets
Another batch before 2.30-rc1
git-gui: Fix selected text colors
Makefile: conditionally include GIT-VERSION-FILE
git-gui: fix colored label backgrounds when using themed widgets
config.mak.uname: remove old NonStop compatibility settings
diff: correct interaction between --exit-code and -I<pattern>
t/perf: fix test_export() failure with BSD `sed`
style: do not "break" in switch() after "return"
compat-util: pretend that stub setitimer() always succeeds
strmap: make callers of strmap_remove() to call it in void context
doc: mention Python 3.x supports
index-format.txt: document v2 format of file system monitor extension
docs: multi-pack-index: remove note about future 'verify' work
init: provide useful advice about init.defaultBranch
get_default_branch_name(): prepare for showing some advice
branch -m: allow renaming a yet-unborn branch
init: document `init.defaultBranch` better
t7900: use --fixed-value in git-maintenance tests
...
Diffstat (limited to 'git-gui/git-gui.sh')
| -rwxr-xr-x | git-gui/git-gui.sh | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 867b8cea46..201524c34e 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -720,9 +720,6 @@ proc rmsel_tag {text} { -background [$text cget -background] \ -foreground [$text cget -foreground] \ -borderwidth 0 - $text tag conf in_sel\ - -background $color::select_bg \ - -foreground $color::select_fg bind $text <Motion> break return $text } @@ -1482,6 +1479,7 @@ proc rescan {after {honor_trustmtime 1}} { } elseif {[run_prepare_commit_msg_hook]} { } elseif {[load_message MERGE_MSG]} { } elseif {[load_message SQUASH_MSG]} { + } elseif {[load_message [get_config commit.template]]} { } $ui_comm edit reset $ui_comm edit modified false @@ -1616,6 +1614,12 @@ proc run_prepare_commit_msg_hook {} { fconfigure $fd_sm -encoding utf-8 puts -nonewline $fd_pcm [read $fd_sm] close $fd_sm + } elseif {[file isfile [get_config commit.template]]} { + set pcm_source "template" + set fd_sm [open [get_config commit.template] r] + fconfigure $fd_sm -encoding utf-8 + puts -nonewline $fd_pcm [read $fd_sm] + close $fd_sm } else { set pcm_source "" } @@ -2305,11 +2309,10 @@ proc do_quit {{rc {1}}} { if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} { file rename -force [gitdir GITGUI_BCK] $save set GITGUI_BCK_exists 0 - } else { + } elseif {[$ui_comm edit modified]} { set msg [string trim [$ui_comm get 0.0 end]] regsub -all -line {[ \r\t]+$} $msg {} msg - if {(![string match amend* $commit_type] - || [$ui_comm edit modified]) + if {![string match amend* $commit_type] && $msg ne {}} { catch { set fd [open $save w] @@ -3322,11 +3325,20 @@ if {!$use_ttk} { .vpane.files paneconfigure .vpane.files.index -sticky news } +proc set_selection_colors {w has_focus} { + foreach tag [list in_diff in_sel] { + $w tag conf $tag \ + -background [expr {$has_focus ? $color::select_bg : $color::inactive_select_bg}] \ + -foreground [expr {$has_focus ? $color::select_fg : $color::inactive_select_fg}] + } +} + foreach i [list $ui_index $ui_workdir] { rmsel_tag $i - $i tag conf in_diff \ - -background $color::select_bg \ - -foreground $color::select_fg + + set_selection_colors $i 0 + bind $i <FocusIn> { set_selection_colors %W 1 } + bind $i <FocusOut> { set_selection_colors %W 0 } } unset i |
