Use readline for the choose files search input

This commit is contained in:
Kovid Goyal
2026-07-05 15:16:11 +05:30
parent 31eb21f9f5
commit 011ef4d319
5 changed files with 184 additions and 25 deletions

View File

@@ -273,6 +273,21 @@ func (self *Readline) MoveCursorToEnd() bool {
return self.move_to_end()
}
// PerformAction runs the specified editing Action directly, without going through
// key resolution. Useful for callers that want to bind their own keys to a
// specific line-editing operation, bypassing this package's own default keymap.
func (self *Readline) PerformAction(ac Action, repeat_count uint) error {
if repeat_count == 0 {
repeat_count = 1
}
err := self.perform_action(ac, repeat_count)
if err == ErrCouldNotPerformAction {
self.loop.Beep()
err = nil
}
return err
}
func (self *Readline) CursorAtEndOfLine() bool {
return self.input_state.cursor.X >= len(self.input_state.lines[self.input_state.cursor.Y])
}