Visitar URL original
fix: reset cursor to overview in sort_files_by_directory, not just new() by agavra · Pull Request #246 · agavra/tuicr · GitHub
Skip to content

fix: reset cursor to overview in sort_files_by_directory, not just new() - #246

Merged
agavra merged 1 commit into
mainfrom
cursor_position
Apr 14, 2026
Merged

agavra merged 1 commit into
mainfrom
cursor_position

Conversation

@agavra

@agavra agavra commented Apr 14, 2026

Copy link
Copy Markdown
Owner

The previous implementation only reset cursor_line/scroll_offset in a new() wrapper, but every transition to diff view (confirm_commit_selection, load_staged_selection, etc.) calls sort_files_by_directory(true) which called jump_to_file(0) and clobbered the cursor back to the first file header. Moving the reset into sort_files_by_directory fixes all paths.

The previous fix only reset cursor_line/scroll_offset in a new() wrapper,
but every transition to diff view (confirm_commit_selection,
load_staged_selection, etc.) calls sort_files_by_directory(true) which
called jump_to_file(0) and clobbered the cursor back to the first file
header. Moving the reset into sort_files_by_directory fixes all paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@agavra
agavra merged commit fec146c into main Apr 14, 2026
5 checks passed
@agavra
agavra deleted the cursor_position branch April 14, 2026 04:14
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.

1 participant