Skip to content

Search panel: arrow key cursor movement in query/replace inputs #311

Description

@JDonaghy

Summary

The search panel's query and replace text inputs don't support Left/Right arrow keys for cursor movement. Characters are always appended at the end; Backspace always deletes from the end. This matches the old bespoke code behavior (not a regression from #302), but now that the Form primitive supports cursor positioning (TextInput.cursor: Option<usize>), we should wire it up.

What needs to change

  • Make search_query_caret and replace_text_caret persistent state (not reset to text.len() at paint time)
  • Handle Left/Right arrow keys in the TUI search panel key handler to move the caret
  • Insert characters at the caret position instead of push()
  • Delete at the caret position on Backspace instead of pop()
  • Handle Home/End to jump to start/end of input
  • Wire the same cursor logic in GTK once the DrawingArea migration lands

Priority

Low — quality-of-life polish, not a functional gap.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions