mirror of
https://github.com/git/git.git
synced 2024-11-05 08:47:56 +01:00
gitk: Fix a couple of bugs in the find function
First, findmore would sometimes get a Tcl error due to relying on varcorder and vrownum having valid values for the rows being searched, but they may not be valid unless update_arcrows is called, so this makes findmore call update_arcrows if necessary. Secondly, in the "touching paths" and "adding/removing string" modes, findmore was treating fhighlights($row) == -1 as meaning the row matches, whereas it only means that we haven't received an answer from the external git diff-tree process about it yet. This fixes it. Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
42a671fc00
commit
cd2bcae798
1 changed files with 11 additions and 4 deletions
15
gitk
15
gitk
|
@ -4950,7 +4950,7 @@ proc findmore {} {
|
||||||
global commitdata commitinfo numcommits findpattern findloc
|
global commitdata commitinfo numcommits findpattern findloc
|
||||||
global findstartline findcurline findallowwrap
|
global findstartline findcurline findallowwrap
|
||||||
global find_dirn gdttype fhighlights fprogcoord
|
global find_dirn gdttype fhighlights fprogcoord
|
||||||
global curview varcorder vrownum varccommits
|
global curview varcorder vrownum varccommits vrowmod
|
||||||
|
|
||||||
if {![info exists find_dirn]} {
|
if {![info exists find_dirn]} {
|
||||||
return 0
|
return 0
|
||||||
|
@ -4986,6 +4986,9 @@ proc findmore {} {
|
||||||
set n 500
|
set n 500
|
||||||
set moretodo 1
|
set moretodo 1
|
||||||
}
|
}
|
||||||
|
if {$l + ($find_dirn > 0? $n: 1) > $vrowmod($curview)} {
|
||||||
|
update_arcrows $curview
|
||||||
|
}
|
||||||
set found 0
|
set found 0
|
||||||
set domore 1
|
set domore 1
|
||||||
set ai [bsearch $vrownum($curview) $l]
|
set ai [bsearch $vrownum($curview) $l]
|
||||||
|
@ -5032,14 +5035,18 @@ proc findmore {} {
|
||||||
}
|
}
|
||||||
set id [lindex $ids [expr {$l - $arow}]]
|
set id [lindex $ids [expr {$l - $arow}]]
|
||||||
if {![info exists fhighlights($l)]} {
|
if {![info exists fhighlights($l)]} {
|
||||||
|
# this sets fhighlights($l) to -1
|
||||||
askfilehighlight $l $id
|
askfilehighlight $l $id
|
||||||
|
}
|
||||||
|
if {$fhighlights($l) > 0} {
|
||||||
|
set found $domore
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if {$fhighlights($l) < 0} {
|
||||||
if {$domore} {
|
if {$domore} {
|
||||||
set domore 0
|
set domore 0
|
||||||
set findcurline [expr {$l - $find_dirn}]
|
set findcurline [expr {$l - $find_dirn}]
|
||||||
}
|
}
|
||||||
} elseif {$fhighlights($l)} {
|
|
||||||
set found $domore
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue