"gq" is not working properly when it is supposed to join two lines
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
- Set vim.textwidth to some value (I use 35)
- Type two lines, e.g.

- Put the cursor on the first line and then press "gq" then "j"
- Result:

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

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
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 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