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 -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20240424181024.GD24132%40phoenix.