mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-07 15:40:24 +09:00
Merge pull request #3914 from matthias314/m3/fix-issue-3700
quick fix for #3700
This commit is contained in:
@@ -1144,8 +1144,7 @@ func (h *BufPane) find(useRegex bool) bool {
|
||||
match, found, err := h.Buf.FindNext(resp, h.Buf.Start(), h.Buf.End(), h.searchOrig, true, useRegex)
|
||||
if err != nil {
|
||||
InfoBar.Error(err)
|
||||
}
|
||||
if found {
|
||||
} else if found {
|
||||
h.Cursor.SetSelectionStart(match[0])
|
||||
h.Cursor.SetSelectionEnd(match[1])
|
||||
h.Cursor.OrigSelection[0] = h.Cursor.CurSelection[0]
|
||||
|
||||
@@ -41,12 +41,21 @@ func findLineParams(b *Buffer, start, end Loc, i int, r *regexp.Regexp) ([]byte,
|
||||
}
|
||||
}
|
||||
|
||||
if padMode == padStart {
|
||||
r = regexp.MustCompile(".(?:" + r.String() + ")")
|
||||
} else if padMode == padEnd {
|
||||
r = regexp.MustCompile("(?:" + r.String() + ").")
|
||||
} else if padMode == padStart|padEnd {
|
||||
r = regexp.MustCompile(".(?:" + r.String() + ").")
|
||||
if padMode != 0 {
|
||||
re, err := regexp.Compile(r.String() + `\E`)
|
||||
if err == nil {
|
||||
// r contains \Q without closing \E
|
||||
r = re
|
||||
}
|
||||
|
||||
if padMode == padStart {
|
||||
r = regexp.MustCompile(".(?:" + r.String() + ")")
|
||||
} else if padMode == padEnd {
|
||||
r = regexp.MustCompile("(?:" + r.String() + ").")
|
||||
} else {
|
||||
// padMode == padStart|padEnd
|
||||
r = regexp.MustCompile(".(?:" + r.String() + ").")
|
||||
}
|
||||
}
|
||||
|
||||
return l, charpos, padMode, r
|
||||
|
||||
Reference in New Issue
Block a user