发布

  • fix(nvim): preserve list cursor position on picker resume (#613)

    frostbyte_neo 发布于 2026-06-21 15:02:44 +00:00

    • fix(nvim): preserve list cursor position on picker resume

    Resuming a picker wrote the saved query into the input buffer, whose
    on_lines callback scheduled on_input_change. That re-ran the search and
    reset the cursor to the first result, discarding the restored position.

    Suppress that single on_input_change during restore so the snapshot's
    items and cursor are kept verbatim, rendering once instead of relying on
    a second scheduled re-assert.

    • fix(nvim): preserve list cursor position on picker resume

    Resuming a picker reset the selected entry to the first result. The saved
    cursor was restored, but writing the query into the input buffer triggers
    on_input_change, which re-runs the search and sets S.cursor = 1.

    Re-running the search on resume is intentional (results may have changed
    since close), so instead of suppressing it, thread the saved cursor
    through: restore_from_state stashes it in pending_restore_cursor and the
    re-search restores that position, clamped to the fresh result count.

    下载附件