VSCodeVim / VSCodeVim/Vim

Indent using `==` or `=` on visual selection does not properly indent

Open
#4,205 3 comments 1 reaction 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

Describe the bug
I have been able to reliably reproduce this in json files, but not in other languages. Using == or = on visual selection does not always indent properly.

To Reproduce
In JSON if you have an improperly indented line and hit == it will not indent. However, let's say the previous line is indented properly, if you hit 2== from that line then the line that would not indent will now indent. It also works properly in select mode if there are lines that are indented properly in the selection.

{
    "naut.auto-install": true,
"typescript.preferences.quoteStyle": "single",
    "typescript.referencesCodeLens.enabled": true
}

== on line 3 does nothing
2== from line 2 indents line 3 as expected
= on 2 selected with 3 works as expected
= on 3 and 4 selected deindents 4 (not expected)

Expected behavior
== is contextual and should indent based on surrounding code.

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

No file or test is named. Start by reproducing the JSON example with == and = in visual or select mode, then trace the relevant indentation behavior. Done means improperly indented lines are corrected consistently from a single line or selection, including the cases described.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.