mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-25 16:30:27 +09:00
Search the last match on line when search back (#2156)
This commit is contained in:
@@ -91,9 +91,10 @@ func (b *Buffer) findUp(r *regexp.Regexp, start, end Loc) ([2]Loc, bool) {
|
||||
l = util.SliceStart(l, end.X)
|
||||
}
|
||||
|
||||
match := r.FindIndex(l)
|
||||
all_matches := r.FindAllIndex(l, -1)
|
||||
|
||||
if match != nil {
|
||||
if all_matches != nil {
|
||||
match := all_matches[len(all_matches)-1]
|
||||
start := Loc{charpos + util.RunePos(l, match[0]), i}
|
||||
end := Loc{charpos + util.RunePos(l, match[1]), i}
|
||||
return [2]Loc{start, end}, true
|
||||
|
||||
Reference in New Issue
Block a user