Skip to content

Commit 4510291

Browse files
committed
handle regexps with missing \E (quick fix for #3700)
1 parent 9183fbe commit 4510291

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internal/buffer/search.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ func findLineParams(b *Buffer, start, end Loc, i int, r *regexp.Regexp) ([]byte,
4141
}
4242
}
4343

44+
re, err := regexp.Compile(r.String() + `\E`)
45+
if err == nil {
46+
// r contains \Q without closing \E
47+
r = re
48+
}
49+
4450
if padMode == padStart {
4551
r = regexp.MustCompile(".(?:" + r.String() + ")")
4652
} else if padMode == padEnd {

0 commit comments

Comments
 (0)