VSCodeVim / VSCodeVim/Vim

"gq" is not working properly when it is supposed to join two lines

Open
#7,056 1 comment 6 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

Describe the bug
Suppose I have two lines, each of them has fewer words than the "vim.textwidth". When my cursor is on the first line, if I press "gq+j", the two lines can not be joined, but rather whitespace will be placed before the second line.

To Reproduce

  1. Set vim.textwidth to some value (I use 35)
  2. Type two lines, e.g.
    image
  3. Put the cursor on the first line and then press "gq" then "j"
  4. Result:
    image

Expected behavior
After pressing "gq+j" it should become
image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.21.7
  • VSCode version: 1.58.0
  • OS: Windows 10

Additional context
This bug should be caused by update 1.20.2.

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 reproducing the issue with vim.textwidth set to 35, two short lines, and the gq then j sequence. Compare the result with the expected joined text, using the reported VSCodeVim 1.21.7 and VS Code 1.58.0 environment as a reference. Done means gq+j joins the two lines without inserting leading whitespace.

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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.