Visual Mode: S command and position of the cursor after the operation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
In vim surround when using the S command in Visual Mode the cursor is positioned before the first bracket, quote.
Remark: In Visual Studio code the cursor is positioned at its old absolute position.
Suppose you have the following code:
if jane:
print("helene")
If you select jane and type S) the cursor will be positioned on the n where is surround it is positioned on the newly inserted (
The advantage of the surround behavior is that the ( cursor position let you:
- Move to the end using
% - Insert a function name using
I functionanme
Remark: the ys command behave like in vim by moving the cursor at the opening bracket.
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 tracing the Visual Mode S command handling and compare its cursor placement with the existing ys behavior. Reproduce the jane example in VS Code; done means S) places the cursor on the newly inserted opening parenthesis, matching the stated surround behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100