Repository navigation
Reopening a file puts me back where I was in it - #514
Merged
Merged
Conversation
FilePositionStore keeps each file's cursor and top line in ~/.tui/TuiCode.positions.json, keyed by full path across folders, most recently used first and capped at 300; files inside .git are never kept. Workbench records a tab's position as it closes, every tab's before a folder switch and on quit, and hands it back as a file's tab is created, before it's added. Anything that opens at a place moves the cursor afterwards, which drops the remembered scroll, so it still wins. The scroll waits for the tab's first draw: before that TG hasn't sized the content to the text, so the viewport can't move past the first screen. Closes #502 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opening a file now puts you back where you last were in it: the same cursor line and column, scrolled the same way. That holds for tabs restored with a folder (after
Ctrl+Q, or switching withor), for every restored tab, not just the active one, and for a file closed and reopened from the Explorer or quick open. It's remembered per file path, so the same file reached from another folder comes back at the same place.Anything that opens a file at a place still goes there: a Find result, Go to definition, Usages, Back / Forward,
Enterin a diff,tuicode file:42. A file that got shorter lands on its nearest line. Commit messages and rebase todos (anything inside.git) always open at the top.Closes #502
Notes
~/.tui/TuiCode.positions.json, capped at the 300 most recently used files. They're written when a tab closes, before a folder switch and on quit, never per keystroke.a-team try tuicode 514