Re: [REGRESSION] git-gui

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 04 April 2008, Shawn O. Pearce wrote:
> > Anyone else got any opinions on an appropriate shortcut?  How about
> > '=' and '-' (+ and - without the shift), or are those not necessarily
> > together either?  (Are there really layouts where '[' and ']' aren't
> > next to each other?)
> 
> I don't know, [ and ] seem reasonable to me.  Git is mostly a source
> code control system.  A lot of languages use [ and ] as part of
> their syntax.  If you are typing on a keyboard that is difficult to
> access these keys on, you are probably already used to contorting
> your fingers.  :-|

To clarify, [ and ] are quite easy to type for me: the first problem
is that to type [ I have to press AltGr-è (or AltGr-8). With Ctrl, it
makes three keypresses: I can handle this, but - second problem - it
seems Tcl/Tk cannot (unless I'm wrong, which can also be very likely):

keys.tcl:
-->8--
#!/usr/bin/wish
bind . <Key> {
	puts "            %%K - %%k - %%N - %%T - %%D - %%A - %%d"
	puts "You pressed %K - %k - %N - %T - %D - %A - %d"
}
--8<--

Trying Ctrl+[:
$ ./keys.tcl 
            %K - %k - %N - %T - %D - %A - %d 
You pressed Control_R - 109 - 65508 - 2 - 109 - {} - ?? 
            %K - %k - %N - %T - %D - %A - %d 
You pressed ISO_Level3_Shift - 113 - 65027 - 2 - 113 - {} - ?? 
            %K - %k - %N - %T - %D - %A - %d 
You pressed ?? - 34 - 0 - 2 - 34 - ?

Trying [:
$ ./keys.tcl 
            %K - %k - %N - %T - %D - %A - %d 
You pressed ISO_Level3_Shift - 113 - 65027 - 2 - 113 - {} - ?? 
            %K - %k - %N - %T - %D - %A - %d 
You pressed ?? - 34 - 0 - 2 - 34 - [ - ?? 

So, it doesn't recognize [ at all at the keysym (%K) level.
No idea why. This is Tcl/Tk 8.4.15 on Linux.

> I wrote up a patch today based on Michele's suggested change.
> It works everywhere I can test, but I don't have an 8.4.0
> installation like the original poster.
> 
> Unless someone posts a patch to change the keys away from [ and ]
> I say leave them as-is.  But I'm willing to entertain a change if
> someone who cares writes a patch for it.

Here it is. Of course if I'm the only one that has problems with ]/[,
forget it. But it seems reasonable to me to do:

ctrl-+ and ctrl-=	-> more context
ctrl--			-> less context

Since these keybindings are used in gitk too, they should be safe. If
someone doesn't like this change, just say so. If someone thinks my
setup is strange and knows what to do to fix it up, let me know.

-->8--
>From 4334c7690d80f7c05ec40f2efa4306ef88933469 Mon Sep 17 00:00:00 2001
From: Michele Ballabio <barra_cuda@xxxxxxxxxxxx>
Date: Fri, 4 Apr 2008 18:29:48 +0200
Subject: [PATCH] git-gui: use +/- instead of ]/[ to show more/less context in diff

On some systems, brackets cannot be used as event details
(they don't have a keysym), so use +/- instead (both on
keyboard and keypad) and add ctrl-= as a synonym of ctrl-+
for convenience.

Signed-off-by: Michele Ballabio <barra_cuda@xxxxxxxxxxxx>
---
 git-gui.sh |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 748efcc..744b51c 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2064,11 +2064,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 
 	.mbar.commit add command -label [mc "Show Less Context"] \
 		-command show_less_context \
-		-accelerator $M1T-\[
+		-accelerator $M1T-\-
 
 	.mbar.commit add command -label [mc "Show More Context"] \
 		-command show_more_context \
-		-accelerator $M1T-\]
+		-accelerator "$M1T-+ $M1T-="
 
 	.mbar.commit add separator
 
@@ -2715,8 +2715,11 @@ bind $ui_comm <$M1B-Key-v> {tk_textPaste %W; %W see insert; break}
 bind $ui_comm <$M1B-Key-V> {tk_textPaste %W; %W see insert; break}
 bind $ui_comm <$M1B-Key-a> {%W tag add sel 0.0 end;break}
 bind $ui_comm <$M1B-Key-A> {%W tag add sel 0.0 end;break}
-bind $ui_comm <$M1B-Key-bracketleft> {show_less_context;break}
-bind $ui_comm <$M1B-Key-bracketright> {show_more_context;break}
+bind $ui_comm <$M1B-Key-minus> {show_less_context;break}
+bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}
+bind $ui_comm <$M1B-Key-equal> {show_more_context;break}
+bind $ui_comm <$M1B-Key-plus> {show_more_context;break}
+bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}
 
 bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}
 bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}
@@ -2760,8 +2763,11 @@ bind .   <$M1B-Key-t> do_add_selection
 bind .   <$M1B-Key-T> do_add_selection
 bind .   <$M1B-Key-i> do_add_all
 bind .   <$M1B-Key-I> do_add_all
-bind .   <$M1B-Key-bracketleft> {show_less_context;break}
-bind .   <$M1B-Key-bracketright> {show_more_context;break}
+bind .   <$M1B-Key-minus> {show_less_context;break}
+bind .   <$M1B-Key-KP_Subtract> {show_less_context;break}
+bind .   <$M1B-Key-equal> {show_more_context;break}
+bind .   <$M1B-Key-plus> {show_more_context;break}
+bind .   <$M1B-Key-KP_Add> {show_more_context;break}
 bind .   <$M1B-Key-Return> do_commit
 foreach i [list $ui_index $ui_workdir] {
 	bind $i <Button-1>       "toggle_or_diff         $i %x %y; break"
-- 
1.5.4.5

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux