git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view
@ 2011-10-13 13:48 Bert Wesarg
  2011-10-13 13:48 ` [PATCH 2/4] git-gui: clear the goto line input when hiding Bert Wesarg
  2011-10-15 22:22 ` [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view Pat Thoyts
  0 siblings, 2 replies; 10+ messages in thread
From: Bert Wesarg @ 2011-10-13 13:48 UTC (permalink / raw
  To: Pat Thoyts; +Cc: David Fries, git, Bert Wesarg

It was possible to open the search input (Ctrl+S) and the goto-line input
(Ctrl+G) at the same time. Prevent this.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 lib/blame.tcl |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/lib/blame.tcl b/lib/blame.tcl
index 2099776..691941e 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -280,11 +280,11 @@ constructor new {i_commit i_path i_jump} {
 	$w.ctxm add command \
 		-label [mc "Find Text..."] \
 		-accelerator F7 \
-		-command [list searchbar::show $finder]
+		-command [cb _show_finder]
 	$w.ctxm add command \
 		-label [mc "Goto Line..."] \
 		-accelerator "Ctrl-G" \
-		-command [list linebar::show $gotoline]
+		-command [cb _show_linebar]
 	menu $w.ctxm.enc
 	build_encoding_menu $w.ctxm.enc [cb _setencoding]
 	$w.ctxm add cascade \
@@ -351,13 +351,13 @@ constructor new {i_commit i_path i_jump} {
 	bind $w_cviewer <Tab>       "[list focus $w_file];break"
 	bind $w_cviewer <Button-1>   [list focus $w_cviewer]
 	bind $w_file    <Visibility> [cb _focus_search $w_file]
-	bind $top       <F7>         [list searchbar::show $finder]
-	bind $top       <Key-slash>  [list searchbar::show $finder]
-	bind $top    <Control-Key-s> [list searchbar::show $finder]
+	bind $top       <F7>         [cb _show_finder]
+	bind $top       <Key-slash>  [cb _show_finder]
+	bind $top    <Control-Key-s> [cb _show_finder]
 	bind $top       <Escape>     [list searchbar::hide $finder]
 	bind $top       <F3>         [list searchbar::find_next $finder]
 	bind $top       <Shift-F3>   [list searchbar::find_prev $finder]
-	bind $top    <Control-Key-g> [list linebar::show $gotoline]
+	bind $top    <Control-Key-g> [cb _show_linebar]
 	catch { bind $top <Shift-Key-XF86_Switch_VT_3> [list searchbar::find_prev $finder] }
 
 	grid configure $w.header -sticky ew
@@ -1349,4 +1349,14 @@ method _resize {new_height} {
 	set old_height $new_height
 }
 
+method _show_finder {} {
+	linebar::hide $gotoline
+	searchbar::show $finder
+}
+
+method _show_linebar {} {
+	searchbar::hide $finder
+	linebar::show $gotoline
+}
+
 }
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] git-gui: clear the goto line input when hiding
  2011-10-13 13:48 [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view Bert Wesarg
@ 2011-10-13 13:48 ` Bert Wesarg
  2011-10-13 13:48   ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Bert Wesarg
  2011-10-15 22:20   ` [PATCH 2/4] git-gui: clear the goto line input when hiding Pat Thoyts
  2011-10-15 22:22 ` [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view Pat Thoyts
  1 sibling, 2 replies; 10+ messages in thread
From: Bert Wesarg @ 2011-10-13 13:48 UTC (permalink / raw
  To: Pat Thoyts; +Cc: David Fries, git, Bert Wesarg

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 lib/line.tcl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/line.tcl b/lib/line.tcl
index 4913bdd..692485a 100644
--- a/lib/line.tcl
+++ b/lib/line.tcl
@@ -41,6 +41,7 @@ method show {} {
 
 method hide {} {
 	if {[visible $this]} {
+		$w.ent delete 0 end
 		focus $ctext
 		grid remove $w
 	}
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] git-gui: only except numbers in the goto-line input
  2011-10-13 13:48 ` [PATCH 2/4] git-gui: clear the goto line input when hiding Bert Wesarg
@ 2011-10-13 13:48   ` Bert Wesarg
  2011-10-13 13:48     ` [RFC/PATCH 4/4] git-gui: incremental goto line in blame view Bert Wesarg
  2011-10-15 22:17     ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Pat Thoyts
  2011-10-15 22:20   ` [PATCH 2/4] git-gui: clear the goto line input when hiding Pat Thoyts
  1 sibling, 2 replies; 10+ messages in thread
From: Bert Wesarg @ 2011-10-13 13:48 UTC (permalink / raw
  To: Pat Thoyts; +Cc: David Fries, git, Bert Wesarg

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 lib/line.tcl |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/line.tcl b/lib/line.tcl
index 692485a..70785e1 100644
--- a/lib/line.tcl
+++ b/lib/line.tcl
@@ -15,7 +15,11 @@ constructor new {i_w i_text args} {
 
 	${NS}::frame  $w
 	${NS}::label  $w.l       -text [mc "Goto Line:"]
-	entry  $w.ent -textvariable ${__this}::linenum -background lightgreen
+	entry  $w.ent \
+		-textvariable ${__this}::linenum \
+		-background lightgreen \
+		-validate key \
+		-validatecommand [cb _validate %P]
 	${NS}::button $w.bn      -text [mc Go] -command [cb _incrgoto]
 
 	pack   $w.l   -side left
@@ -26,7 +30,7 @@ constructor new {i_w i_text args} {
 	grid remove $w
 
 	bind $w.ent <Return> [cb _incrgoto]
-	bind $w.ent <Escape> [list linebar::hide $this]
+	bind $w.ent <Escape> [cb hide]
 
 	bind $w <Destroy> [list delete_this $this]
 	return $this
@@ -55,6 +59,14 @@ method editor {} {
 	return $w.ent
 }
 
+method _validate {P} {
+	# only accept numbers as input
+	if {[regexp {\d*} $P]} {
+		return 1
+	}
+	return 0
+}
+
 method _incrgoto {} {
 	if {$linenum ne {}} {
 		$ctext see $linenum.0
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC/PATCH 4/4] git-gui: incremental goto line in blame view
  2011-10-13 13:48   ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Bert Wesarg
@ 2011-10-13 13:48     ` Bert Wesarg
  2011-10-15 22:26       ` Pat Thoyts
  2011-10-15 22:17     ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Pat Thoyts
  1 sibling, 1 reply; 10+ messages in thread
From: Bert Wesarg @ 2011-10-13 13:48 UTC (permalink / raw
  To: Pat Thoyts; +Cc: David Fries, git, Bert Wesarg

The view jumps now to the given line number after each key press.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---

I didn't know this before, but gedits goto-line-dialog works this way.

 lib/line.tcl |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/line.tcl b/lib/line.tcl
index 70785e1..0113e06 100644
--- a/lib/line.tcl
+++ b/lib/line.tcl
@@ -20,7 +20,7 @@ constructor new {i_w i_text args} {
 		-background lightgreen \
 		-validate key \
 		-validatecommand [cb _validate %P]
-	${NS}::button $w.bn      -text [mc Go] -command [cb _incrgoto]
+	${NS}::button $w.bn      -text [mc Go] -command [cb _goto]
 
 	pack   $w.l   -side left
 	pack   $w.bn  -side right
@@ -29,7 +29,8 @@ constructor new {i_w i_text args} {
 	eval grid conf $w -sticky we $args
 	grid remove $w
 
-	bind $w.ent <Return> [cb _incrgoto]
+	trace add variable linenum write [cb _goto_cb]
+	bind $w.ent <Return> [cb _goto]
 	bind $w.ent <Escape> [cb hide]
 
 	bind $w <Destroy> [list delete_this $this]
@@ -67,10 +68,16 @@ method _validate {P} {
 	return 0
 }
 
-method _incrgoto {} {
+method _goto_cb {name ix op} {
+	after idle [cb _goto 1]
+}
+
+method _goto {{nohide {0}}} {
 	if {$linenum ne {}} {
 		$ctext see $linenum.0
-		hide $this
+		if {!$nohide} {
+			hide $this
+		}
 	}
 }
 
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] git-gui: only except numbers in the goto-line input
  2011-10-13 13:48   ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Bert Wesarg
  2011-10-13 13:48     ` [RFC/PATCH 4/4] git-gui: incremental goto line in blame view Bert Wesarg
@ 2011-10-15 22:17     ` Pat Thoyts
  2011-10-16 10:32       ` Bert Wesarg
  1 sibling, 1 reply; 10+ messages in thread
From: Pat Thoyts @ 2011-10-15 22:17 UTC (permalink / raw
  To: Bert Wesarg; +Cc: David Fries, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> lib/line.tcl |   16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
>
>diff --git a/lib/line.tcl b/lib/line.tcl
>index 692485a..70785e1 100644
>--- a/lib/line.tcl
>+++ b/lib/line.tcl
>@@ -15,7 +15,11 @@ constructor new {i_w i_text args} {
> 
> 	${NS}::frame  $w
> 	${NS}::label  $w.l       -text [mc "Goto Line:"]
>-	entry  $w.ent -textvariable ${__this}::linenum -background lightgreen
>+	entry  $w.ent \
>+		-textvariable ${__this}::linenum \
>+		-background lightgreen \
>+		-validate key \
>+		-validatecommand [cb _validate %P]
> 	${NS}::button $w.bn      -text [mc Go] -command [cb _incrgoto]
> 
> 	pack   $w.l   -side left
>@@ -26,7 +30,7 @@ constructor new {i_w i_text args} {
> 	grid remove $w
> 
> 	bind $w.ent <Return> [cb _incrgoto]
>-	bind $w.ent <Escape> [list linebar::hide $this]
>+	bind $w.ent <Escape> [cb hide]
> 
> 	bind $w <Destroy> [list delete_this $this]
> 	return $this
>@@ -55,6 +59,14 @@ method editor {} {
> 	return $w.ent
> }
> 
>+method _validate {P} {
>+	# only accept numbers as input
>+	if {[regexp {\d*} $P]} {
>+		return 1
>+	}
>+	return 0
>+}
>+
> method _incrgoto {} {
> 	if {$linenum ne {}} {
> 		$ctext see $linenum.0

This one doesn't actually work when I try it it accepts alphanumeric
input. However, replacing the validate body with
  string is integer $P
fixes it to operate as intended so I'll replace it with this.
Looks like it needs theming too but that can be a separate patch.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] git-gui: clear the goto line input when hiding
  2011-10-13 13:48 ` [PATCH 2/4] git-gui: clear the goto line input when hiding Bert Wesarg
  2011-10-13 13:48   ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Bert Wesarg
@ 2011-10-15 22:20   ` Pat Thoyts
  2011-10-16 10:29     ` Bert Wesarg
  1 sibling, 1 reply; 10+ messages in thread
From: Pat Thoyts @ 2011-10-15 22:20 UTC (permalink / raw
  To: Bert Wesarg; +Cc: David Fries, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> lib/line.tcl |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
>diff --git a/lib/line.tcl b/lib/line.tcl
>index 4913bdd..692485a 100644
>--- a/lib/line.tcl
>+++ b/lib/line.tcl
>@@ -41,6 +41,7 @@ method show {} {
> 
> method hide {} {
> 	if {[visible $this]} {
>+		$w.ent delete 0 end
> 		focus $ctext
> 		grid remove $w
> 	}

You don't say why this one gets cleared but the search box is not
cleared.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view
  2011-10-13 13:48 [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view Bert Wesarg
  2011-10-13 13:48 ` [PATCH 2/4] git-gui: clear the goto line input when hiding Bert Wesarg
@ 2011-10-15 22:22 ` Pat Thoyts
  1 sibling, 0 replies; 10+ messages in thread
From: Pat Thoyts @ 2011-10-15 22:22 UTC (permalink / raw
  To: Bert Wesarg; +Cc: David Fries, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>It was possible to open the search input (Ctrl+S) and the goto-line input
>(Ctrl+G) at the same time. Prevent this.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> lib/blame.tcl |   22 ++++++++++++++++------
> 1 files changed, 16 insertions(+), 6 deletions(-)
>
>diff --git a/lib/blame.tcl b/lib/blame.tcl
>index 2099776..691941e 100644
>--- a/lib/blame.tcl
>+++ b/lib/blame.tcl
>@@ -280,11 +280,11 @@ constructor new {i_commit i_path i_jump} {
> 	$w.ctxm add command \
> 		-label [mc "Find Text..."] \
> 		-accelerator F7 \
>-		-command [list searchbar::show $finder]
>+		-command [cb _show_finder]
> 	$w.ctxm add command \
> 		-label [mc "Goto Line..."] \
> 		-accelerator "Ctrl-G" \
>-		-command [list linebar::show $gotoline]
>+		-command [cb _show_linebar]
> 	menu $w.ctxm.enc
> 	build_encoding_menu $w.ctxm.enc [cb _setencoding]
> 	$w.ctxm add cascade \
>@@ -351,13 +351,13 @@ constructor new {i_commit i_path i_jump} {
> 	bind $w_cviewer <Tab>       "[list focus $w_file];break"
> 	bind $w_cviewer <Button-1>   [list focus $w_cviewer]
> 	bind $w_file    <Visibility> [cb _focus_search $w_file]
>-	bind $top       <F7>         [list searchbar::show $finder]
>-	bind $top       <Key-slash>  [list searchbar::show $finder]
>-	bind $top    <Control-Key-s> [list searchbar::show $finder]
>+	bind $top       <F7>         [cb _show_finder]
>+	bind $top       <Key-slash>  [cb _show_finder]
>+	bind $top    <Control-Key-s> [cb _show_finder]
> 	bind $top       <Escape>     [list searchbar::hide $finder]
> 	bind $top       <F3>         [list searchbar::find_next $finder]
> 	bind $top       <Shift-F3>   [list searchbar::find_prev $finder]
>-	bind $top    <Control-Key-g> [list linebar::show $gotoline]
>+	bind $top    <Control-Key-g> [cb _show_linebar]
> 	catch { bind $top <Shift-Key-XF86_Switch_VT_3> [list searchbar::find_prev $finder] }
> 
> 	grid configure $w.header -sticky ew
>@@ -1349,4 +1349,14 @@ method _resize {new_height} {
> 	set old_height $new_height
> }
> 
>+method _show_finder {} {
>+	linebar::hide $gotoline
>+	searchbar::show $finder
>+}
>+
>+method _show_linebar {} {
>+	searchbar::hide $finder
>+	linebar::show $gotoline
>+}
>+
> }

Looks good. Will apply.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC/PATCH 4/4] git-gui: incremental goto line in blame view
  2011-10-13 13:48     ` [RFC/PATCH 4/4] git-gui: incremental goto line in blame view Bert Wesarg
@ 2011-10-15 22:26       ` Pat Thoyts
  0 siblings, 0 replies; 10+ messages in thread
From: Pat Thoyts @ 2011-10-15 22:26 UTC (permalink / raw
  To: Bert Wesarg; +Cc: David Fries, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>The view jumps now to the given line number after each key press.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
>
>I didn't know this before, but gedits goto-line-dialog works this way.
>
> lib/line.tcl |   15 +++++++++++----
> 1 files changed, 11 insertions(+), 4 deletions(-)
>
>diff --git a/lib/line.tcl b/lib/line.tcl
>index 70785e1..0113e06 100644
>--- a/lib/line.tcl
>+++ b/lib/line.tcl
>@@ -20,7 +20,7 @@ constructor new {i_w i_text args} {
> 		-background lightgreen \
> 		-validate key \
> 		-validatecommand [cb _validate %P]
>-	${NS}::button $w.bn      -text [mc Go] -command [cb _incrgoto]
>+	${NS}::button $w.bn      -text [mc Go] -command [cb _goto]
> 
> 	pack   $w.l   -side left
> 	pack   $w.bn  -side right
>@@ -29,7 +29,8 @@ constructor new {i_w i_text args} {
> 	eval grid conf $w -sticky we $args
> 	grid remove $w
> 
>-	bind $w.ent <Return> [cb _incrgoto]
>+	trace add variable linenum write [cb _goto_cb]
>+	bind $w.ent <Return> [cb _goto]
> 	bind $w.ent <Escape> [cb hide]
> 
> 	bind $w <Destroy> [list delete_this $this]
>@@ -67,10 +68,16 @@ method _validate {P} {
> 	return 0
> }
> 
>-method _incrgoto {} {
>+method _goto_cb {name ix op} {
>+	after idle [cb _goto 1]
>+}
>+
>+method _goto {{nohide {0}}} {
> 	if {$linenum ne {}} {
> 		$ctext see $linenum.0
>-		hide $this
>+		if {!$nohide} {
>+			hide $this
>+		}
> 	}
> }

Works fine. Will apply.

OK These 4 patches are applied and pushed to master branch - with
modifications made to 'only accept numbers in the goto-line input' made
as mentioned.

Thanks,

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] git-gui: clear the goto line input when hiding
  2011-10-15 22:20   ` [PATCH 2/4] git-gui: clear the goto line input when hiding Pat Thoyts
@ 2011-10-16 10:29     ` Bert Wesarg
  0 siblings, 0 replies; 10+ messages in thread
From: Bert Wesarg @ 2011-10-16 10:29 UTC (permalink / raw
  To: Pat Thoyts; +Cc: David Fries, git

Hi,

On Sun, Oct 16, 2011 at 00:20, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>---
>> lib/line.tcl |    1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>>diff --git a/lib/line.tcl b/lib/line.tcl
>>index 4913bdd..692485a 100644
>>--- a/lib/line.tcl
>>+++ b/lib/line.tcl
>>@@ -41,6 +41,7 @@ method show {} {
>>
>> method hide {} {
>>       if {[visible $this]} {
>>+              $w.ent delete 0 end
>>               focus $ctext
>>               grid remove $w
>>       }
>
> You don't say why this one gets cleared but the search box is not
> cleared.

Because thats a different patch series. Which I already send to you.
Starting with "[PATCH 1/4] git-gui: handle config booleans without
value".

Bert

>
> --
> Pat Thoyts                            http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] git-gui: only except numbers in the goto-line input
  2011-10-15 22:17     ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Pat Thoyts
@ 2011-10-16 10:32       ` Bert Wesarg
  0 siblings, 0 replies; 10+ messages in thread
From: Bert Wesarg @ 2011-10-16 10:32 UTC (permalink / raw
  To: Pat Thoyts; +Cc: David Fries, git

Hi,

On Sun, Oct 16, 2011 at 00:17, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>---
>> lib/line.tcl |   16 ++++++++++++++--
>> 1 files changed, 14 insertions(+), 2 deletions(-)
>>
>>diff --git a/lib/line.tcl b/lib/line.tcl
>>index 692485a..70785e1 100644
>>--- a/lib/line.tcl
>>+++ b/lib/line.tcl
>>@@ -15,7 +15,11 @@ constructor new {i_w i_text args} {
>>
>>       ${NS}::frame  $w
>>       ${NS}::label  $w.l       -text [mc "Goto Line:"]
>>-      entry  $w.ent -textvariable ${__this}::linenum -background lightgreen
>>+      entry  $w.ent \
>>+              -textvariable ${__this}::linenum \
>>+              -background lightgreen \
>>+              -validate key \
>>+              -validatecommand [cb _validate %P]
>>       ${NS}::button $w.bn      -text [mc Go] -command [cb _incrgoto]
>>
>>       pack   $w.l   -side left
>>@@ -26,7 +30,7 @@ constructor new {i_w i_text args} {
>>       grid remove $w
>>
>>       bind $w.ent <Return> [cb _incrgoto]
>>-      bind $w.ent <Escape> [list linebar::hide $this]
>>+      bind $w.ent <Escape> [cb hide]
>>
>>       bind $w <Destroy> [list delete_this $this]
>>       return $this
>>@@ -55,6 +59,14 @@ method editor {} {
>>       return $w.ent
>> }
>>
>>+method _validate {P} {
>>+      # only accept numbers as input
>>+      if {[regexp {\d*} $P]} {
>>+              return 1
>>+      }
>>+      return 0
>>+}
>>+
>> method _incrgoto {} {
>>       if {$linenum ne {}} {
>>               $ctext see $linenum.0
>
> This one doesn't actually work when I try it it accepts alphanumeric
> input. However, replacing the validate body with
>  string is integer $P
> fixes it to operate as intended so I'll replace it with this.

Sorry, the correct regexp would have been {^\d*$}. But your [string is
integer] should completely suffice. Thanks.

> Looks like it needs theming too but that can be a separate patch.

Theming is not my field, sorry.

Bert

> --
> Pat Thoyts                            http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-10-16 10:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 13:48 [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view Bert Wesarg
2011-10-13 13:48 ` [PATCH 2/4] git-gui: clear the goto line input when hiding Bert Wesarg
2011-10-13 13:48   ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Bert Wesarg
2011-10-13 13:48     ` [RFC/PATCH 4/4] git-gui: incremental goto line in blame view Bert Wesarg
2011-10-15 22:26       ` Pat Thoyts
2011-10-15 22:17     ` [PATCH 3/4] git-gui: only except numbers in the goto-line input Pat Thoyts
2011-10-16 10:32       ` Bert Wesarg
2011-10-15 22:20   ` [PATCH 2/4] git-gui: clear the goto line input when hiding Pat Thoyts
2011-10-16 10:29     ` Bert Wesarg
2011-10-15 22:22 ` [PATCH 1/4] git-gui: search and linenumber input are mutual exclusive in the blame view Pat Thoyts

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).