// 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
found = searchUp(r, v, v.Buf.End(), searchStart)
}
}
- if found {
- lastSearch = searchStr
- } else {
+ if !found {
v.Cursor.ResetSelection()
}
}