Repository navigation
enhance(mapping): reposition cursor on fern-action-remove - #555
Conversation
When removing files or directories with the 'fern-action-remove' mapping, attempt to restore the cursor position. When working in a large project with a lot of files and deeply nested directories, removing a file reloads and redraws the complete tree, which often positions the cursor on the parent node. This is a bit clunky--the user needs to keep jumping through the drawer to get back to where they were, or alternatively use marks to select+remove. This revision attempts to reposition the cursor to where it was before the removal.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe file-removal mapping now saves the cursor before asynchronous cleanup and restores it after the tree reloads and redraws. ChangesFile Removal
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This localized change restores the cursor position after removing a file or directory. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
A bit of an annoying side effect of this change is that the cursor briefly jumps to the parent node, then back to the original cursor position. This is hardly noticeable, but still there. This is because the mapping calls I'm not too sure how best to solve this. Open for suggestions 👍 |
When removing files or directories with the 'fern-action-remove' mapping, attempt to restore the cursor position.
When working in a large project with a lot of files and deeply nested directories, removing a file reloads and redraws the complete tree, which often positions the cursor on the parent node. This is a bit clunky--the user needs to keep jumping through the drawer to get back to where they were, or alternatively use marks to select+remove.
This revision attempts to reposition the cursor to where it was before the removal.
Summary by CodeRabbit