Improve foldFix and add fold-awareness to more actions
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Is your feature request related to a problem? Please describe.
foldFix currently does not adjust all actions for fold-awareness. foldFix also has no test configurations and does not have any specific tests for checking fold-awareness.
Describe the solution you'd like
I have submitted some pull requests (#2867, #2887 ) so far to address this and the following list keeps track of which actions I want to add fold-awareness to and which now have some support.
- deleting
- yanking
- opening lines (I have partially made this fold-aware in an uncommitted change, however the open action code currently relies on vscode's
editor.newLineAfterandeditor.newLineBeforecommands which unfolds code where vim would not. I believe a similar problem exists with pasting.) - pasting/putting
I'm working on more pull requests and they will be referenced here when they are ready.
Testing is difficult as there is no way currently to actually determine the visual or fold-aware state of the editor. However, I have been able to add some tests in #2887 that checks the expected state of a prepared file with folds after performing actions with configuration.foldfix set to true.
Describe alternatives you've considered
The best alternative would be leveraging api features for fold-awareness, but since this is currently blocked (see #1004, Microsoft/vscode#22276) it would be nice to have better support in foldFix for those needing to work with heavily folded files.
Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing foldFix implementation and the tests described in #2887, then review how opening-line and pasting/putting actions use VS Code's editor.newLineAfter and editor.newLineBefore commands. Compare behavior with configuration.foldfix set to true and extend fold-awareness to the unchecked actions, with tests covering folded files as the done condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vim, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100