`gq` is inconsistent when reflowing multiple lines at once
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
gq does not reflow properly when trying to reflow mulitple lines at once
To Reproduce
Steps to reproduce the behavior:
- Paste in the following lines with linebreaks:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante nibh, molestie et accumsan
rhoncus, interdum vel urna. Nullam lacus ipsum, rhoncus
sagittis dapibus id, imperdiet eget ex. Nullam sagittis justo in nunc ultricies sodales. Proin id enim massa. Duis sagittis lacus erat, id molestie tellus
volutpat eu. Ut quis tincidunt justo,
in dictum ex. Aliquam
in lectus at dui
aliquet auctor ac a lorem. Curabitur eget consectetur dolor.
- Select all lines (for example
vip) and thengq. - Observe that the reflowing is very inconsistent.
Expected behavior
I expect it to look as the first after section in the image below, but rather it is very inconsistent in its
line widths.
Screenshots
The first before/after set is what I expect, the latter is the exact same words, but with some added line breaks.

Environment
- Extension (VsCodeVim) version: 1.20.2
- VSCode version: 1.56
- OS: (K)Ubuntu 20.04, Windows 10 Home
Additional context
Add any other context about the problem here.
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 in VSCodeVim with the supplied text, selecting all lines and running gq. Compare the result with the expected first “after” example in the linked screenshot. Done means reflowing the same words produces consistent line widths regardless of the original line breaks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100