Discussion: new way to do NavigateBack C-o: get VSCode command working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
The are some issues around vim's /our C-o implementation, because it only works with one vscode code navigation command (goto Defintion), but not others:
#3990
#3052
We need until now an own command for vim, because workbench.action.navigateBack will record every cursor move:
#3989
There have been attempts (to record jumps from other commands) by people probably more skilled than me ;-) but it did not succeed.
My approach is to get workbench.action.navigateBack to work. Looks like we can do this. Vscode records our cursor movements by j/k because they come from an extension ( I read about that somewhere in vscode issues.). But if we use cursorUp and cursorDown for simple cursor movements, we can get a clean vscode jumplist.
Here is a demo (5 MB, mp4):
https://1drv.ms/u/s!Auamqfb9LjGpbEtF9NMvWkfEadc
It would be a small change to the code, basically: for j, k, up, down with count = 1, use vscodes commands.
Feedback?
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 by locating the handling for j, k, up, and down motions and the existing C-o implementation, then inspect how workbench.action.navigateBack is invoked. Verify the proposed single-step cursor commands produce a clean VS Code jumplist without recording every cursor movement, and check the related issues #3990, #3052, and #3989 for constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100