'breakindent' seems to break gqap

12 views
Skip to first unread message

Gary Johnson

unread,
Apr 24, 2024, 2:09:39 PM4/24/24
to vim...@googlegroups.com
When 'breakindent' is set and the window width is less than
'textwidth', the gqap command reformats indented paragraphs to less
than 'textwidth'.

Steps to reproduce

1. Create a file containing a single paragraph of arbitrary text,
indented by one 8-space tab stop and formatted for a textwidth
of 78. The text below, indented by a tab stop, will do.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam luctus
lectus sodales, dictum augue vel, molestie augue. Duis sit amet
rhoncus justo. Nullam posuere risus semper magna commodo scelerisque.
Duis et venenatis sem. In rhoncus augue sed tempor mattis. Mauris id
aliquet odio.

2. Open that file in vim in an 80-column terminal with this command
(on one line):

$ vim -N -u NONE -i NONE --cmd 'set ai tw=78 breakindent' -c vnew -c 'wincmd w' lorem_ipsum.txt

3. Execute

gqap
Ctrl-W |

4. Note that the paragraph has been reformatted so that the longest
line is 70 columns. (This new text width varies with the window
width in ways I haven't investigated.)

Expected behavior

The paragraph should be formatted for a text width of
'textwidth', regardless of the setting of 'breakindent' or the
window width. It works as expected with 'breakindent' off.

Version of Vim

9.1.366
8.2.2121

Environment

Operating system: Ubuntu 22.04
Terminal: XTerm(389)
Value of $TERM: xterm-256color

Shell: bash 5.1.16(1)-release

Regards,
Gary

Christian Brabandt

unread,
Apr 24, 2024, 5:02:47 PM4/24/24
to vim...@googlegroups.com
Hm, if I see this correctly, I see this behaviour until 7.4.338 (when
breakindent was introduced). :(

Thanks,
Christian
--
His designs were strictly honourable, as the phrase is: that is, to rob
a lady of her fortune by way of marriage.
-- Henry Fielding, "Tom Jones"
Reply all
Reply to author
Forward
0 new messages