gitk: Fix Tcl error: can't unset findcurline
The logic in stopfinding assumes that findcurline will be set if find_dirn is, but findnext and findprev can set find_dirn without setting findcurline. This makes sure we only set find_dirn in those places if findcurline is already set. Signed-off-by: Paul Mackerras <paulus@samba.org>
Paul Mackerras committed
Oct 19, 2007 at 19:09 UTC
eb33a67f218b612f6fb1456e19b40a1f97ff02c0
1 file changed
+2
-2
gitk
+2
-2
@@ -4279,7 +4279,6 @@ proc findnext {restart} {
4279
global findcurline find_dirn
4280
4281
if {[info exists find_dirn]} return
4282
- set find_dirn 1
4282
if {![info exists findcurline]} {
4283
if {$restart} {
4284
dofind
@@ -4287,6 +4286,7 @@ proc findnext {restart} {
4286
bell
4287
}
4288
} else {
4289
+ set find_dirn 1
4290
run findmore
4291
nowbusy finding
4292
}
@@ -4296,10 +4296,10 @@ proc findprev {} {
4296
global findcurline find_dirn
4297
4298
if {[info exists find_dirn]} return
4299
- set find_dirn -1
4299
if {![info exists findcurline]} {
4300
dofind 1
4301
} else {
4302
+ set find_dirn -1
4303
run findmorerev
4304
nowbusy finding
4305
}