From: Pat Thoyts <patthoyts@users.sourceforge.net>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-gui: delegate selection from gutter columns to text output
Date: Fri, 21 Oct 2011 23:24:18 +0100 [thread overview]
Message-ID: <87ehy63rvx.fsf@fox.patthoyts.tk> (raw)
In-Reply-To: <5fc6f5d088e37508f1911f89b4d82932071045e0.1319139888.git.bert.wesarg@googlemail.com> (Bert Wesarg's message of "Thu, 20 Oct 2011 21:45:09 +0200")
Bert Wesarg <bert.wesarg@googlemail.com> writes:
>Selecting in the gutter columns of the blame view should make no sense,
>so delegate any selection action in these columns to the text output
>by selecting whole lines there.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> git-gui.sh | 20 ++++++++++++++++++++
> lib/blame.tcl | 4 +++-
> 2 files changed, 23 insertions(+), 1 deletions(-)
>
>diff --git a/git-gui.sh b/git-gui.sh
>index 21033cb..cf5ed79 100755
>--- a/git-gui.sh
>+++ b/git-gui.sh
>@@ -2077,6 +2077,26 @@ proc many2scrollbar {list mode sb top bottom} {
> foreach w $list {$w $mode moveto $top}
> }
>
>+proc delegate_sel_to {w from} {
>+ set bind_list [list \
>+ <Button-1> \
>+ <B1-Motion> \
>+ <Double-Button-1> \
>+ <Triple-Button-1> \
>+ <Shift-Button-1> \
>+ <Double-Shift-Button-1> \
>+ <Triple-Shift-Button-1> \
>+ ]
>+
>+ foreach seq $bind_list {
>+ set script [bind Text $seq]
>+ set new_script [string map [list %W $w %x 0 word line] $script]
>+ foreach f $from {
>+ bind $f $seq "$new_script; break"
>+ }
>+ }
>+}
>+
> proc incr_font_size {font {amt 1}} {
> set sz [font configure $font -size]
> incr sz $amt
>diff --git a/lib/blame.tcl b/lib/blame.tcl
>index 49eae19..9ab0da5 100644
>--- a/lib/blame.tcl
>+++ b/lib/blame.tcl
>@@ -210,6 +210,8 @@ constructor new {i_commit i_path i_jump} {
>
> set w_columns [list $w_amov $w_asim $w_line $w_file]
>
>+ delegate_sel_to $w_file [list $w_amov $w_asim $w_line]
>+
> ${NS}::scrollbar $w.file_pane.out.sbx \
> -orient h \
> -command [list $w_file xview]
>@@ -315,7 +317,7 @@ constructor new {i_commit i_path i_jump} {
> $i conf -yscrollcommand \
> "[list ::searchbar::scrolled $finder]
> [list many2scrollbar $w_columns yview $w.file_pane.out.sby]"
>- bind $i <Button-1> "
>+ bind $i <Button-1> "+
> [cb _hide_tooltip]
> [cb _click $i @%x,%y]
> focus $i
The patch seems to be fine but I don't think I agree with the intention
here. Currently clicking anywhere that is not marked as a link (blue
underlined text) selects a commit and shows information in the lower
pane. With this change, the left hand columns become inactive in regards
to selecting a commit. I don't see why that is desirable.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
next prev parent reply other threads:[~2011-10-21 22:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 19:45 [PATCH] git-gui: delegate selection from gutter columns to text output Bert Wesarg
2011-10-21 22:24 ` Pat Thoyts [this message]
2011-10-22 15:41 ` Bert Wesarg
2011-10-22 19:38 ` [PATCHv2] " Bert Wesarg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ehy63rvx.fsf@fox.patthoyts.tk \
--to=patthoyts@users.sourceforge.net \
--cc=bert.wesarg@googlemail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.