// Exit the search mode
ExitSearch(v)
return
- case tcell.KeyCtrlQ, tcell.KeyCtrlC, tcell.KeyEnter:
+ case tcell.KeyEnter:
+ // If the user has pressed Enter, they want this to be the lastSearch
+ lastSearch = messenger.response
+ EndSearch()
+ return
+ case tcell.KeyCtrlQ, tcell.KeyCtrlC:
// Done
EndSearch()
return
if match != nil {
v.Cursor.SetSelectionStart(Loc{charPos + runePos(match[0], string(l)), i})
v.Cursor.SetSelectionEnd(Loc{charPos + runePos(match[1], string(l)), i})
+ v.Cursor.OrigSelection[0] = v.Cursor.CurSelection[0]
+ v.Cursor.OrigSelection[1] = v.Cursor.CurSelection[1]
v.Cursor.Loc = v.Cursor.CurSelection[1]
return true
if match != nil {
v.Cursor.SetSelectionStart(Loc{runePos(match[0], string(l)), i})
v.Cursor.SetSelectionEnd(Loc{runePos(match[1], string(l)), i})
+ v.Cursor.OrigSelection[0] = v.Cursor.CurSelection[0]
+ v.Cursor.OrigSelection[1] = v.Cursor.CurSelection[1]
v.Cursor.Loc = v.Cursor.CurSelection[1]
return true
found = searchUp(r, v, v.Buf.End(), searchStart)
}
}
- if found {
- lastSearch = searchStr
- } else {
+ if !found {
v.Cursor.ResetSelection()
}
}