Vim: Reflow (gq) is inconsistently wrapping at the wrong column

Created on 23 Feb 2019  路  4Comments  路  Source: VSCodeVim/Vim

Describe the bug
I'm having some issues understanding the behavior of the reflow command (gq).

Take this example - the vim.textWidth setting is at the default value (80) and I've reflowed this block of text (line 66 to 69) using gq:

image

Notice line 68, the line is 81 columns wide.

Here's a different example - textWidth is still at the default value, and I've selected and reflowed lines 68 and 69:

image

The "xxxxxx" fits on line 68, but was wrapped to line 69 anyway. If I remove one "x" and wrap the lines again using gq, line 68 ends up being 79 columns wide, meaning that gq wrapped at line 79 in this situation.

Is this a bug, or am I misunderstanding some concept of this command?

To Reproduce
Steps to reproduce the behavior:

Install Vim 1.0.8 and Ruby 0.21.1 extensions, create a Ruby file (*.rb) and reproduce the screenshots above.

Expected behavior
I would expect gq to break at column 80 rather than inconsistently breaking at column 81 and 79 for no apparent reason.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.0.8
  • VSCode version: 1.31.1
  • OS: Manjaro 18.0.3
kinbug

Most helpful comment

I have an identical problem.

Given a textwidth of 80, the normal wrapping should be:

Ekrankopio de 2019-04-25 11-59-44

But when doing gq, the result is:

Ekrankopio de 2019-04-25 11-59-52

Only when increasing textwidth to 83, do I get the expected result.

All 4 comments

I have an identical problem.

Given a textwidth of 80, the normal wrapping should be:

Ekrankopio de 2019-04-25 11-59-44

But when doing gq, the result is:

Ekrankopio de 2019-04-25 11-59-52

Only when increasing textwidth to 83, do I get the expected result.

Same problem here. gq wraps to a maximum of 77 columns, even though textwidth is set to 80.

I can open a separate bug for this if it is unrelated, but gq also does not respect the correct indentation when using tabs.

+1 I also just noticed that reflow isn't working correctly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WangRongda picture WangRongda  路  3Comments

spinningarrow picture spinningarrow  路  3Comments

rajinder-yadav picture rajinder-yadav  路  3Comments

orn688 picture orn688  路  3Comments

AndersenJ picture AndersenJ  路  3Comments