VSCodeVim / VSCodeVim/Vim

Visual Mode: S command and position of the cursor after the operation

Open
#7,298 2 comments 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.