This commit is contained in:
Zachary Yedidia
2021-08-02 21:06:28 -04:00
5 changed files with 75 additions and 12 deletions

View File

@@ -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