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:

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:

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):
I have an identical problem.
Given a textwidth of 80, the normal wrapping should be:

But when doing gq, the result is:

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
Most helpful comment
I have an identical problem.
Given a textwidth of 80, the normal wrapping should be:
But when doing
gq, the result is:Only when increasing textwidth to 83, do I get the expected result.