Skip to content

The cursor stays where its item was after a delete - #58

Merged
crustovsky merged 1 commit into
mainfrom
cursor-after-delete
Nov 9, 2026
Merged

crustovsky merged 1 commit into
mainfrom
cursor-after-delete

Conversation

@crustovsky

Copy link
Copy Markdown
Owner

Fixes #54.

  • A remove or move job tells the tab what it takes away; the tab remembers the first entry after the cursor that stays (else the last before it) and the reload puts the cursor there.
  • Any other reload that loses the cursor's name keeps the same row, clamped, and the scroll position.
  • test_window: the cursor item, a marked block around the cursor, the last row, a file removed by something else.

🤖 Generated with Claude Code

Trashing, deleting or moving away the item under the cursor sent the
cursor to the first row and the list to its top: the reload restores
the cursor by name, the name was gone, and the fallback was row 0.
Deleting files one by one down a long folder meant finding the place
again after each.

- When a remove or a move starts, the tab picks the landing place: the
  first entry after the cursor that the job leaves, else the last one
  before it. The reload that misses the cursor's name goes there. A
  marked block with the cursor inside it therefore ends on the item
  after the block, however the monitor batches the changes.
- A reload that loses the cursor's name for any other reason (another
  program removed the file) keeps the cursor on the same row, clamped
  to the last one. The scroll position is kept in both cases, as FAR
  and Opus do.
- The landing place only lives across reloads of the same folder; a
  new listing drops it.

test_window deletes the cursor item, a marked block around the cursor,
the last row, and removes a file behind the window's back.

Fixes #54

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleting the cursor item sends the cursor to the top

1 participant