Gary Johnson wrote:
> On 2021-12-06, Bram Moolenaar wrote:
> > Patch 8.2.3754 (after 8.2.3615)
> > Problem: Undesired changing of the indent of the first formatted line.
> > Solution: Do not indent the first formatted line.
> > Files: src/textformat.c, src/testdir/test_indent.vim
>
> Wonderful! Works with all the testing I did with C, Vim script and
> plain text. Thank you!
>
> I hope this works for the OP. The indentation of the OP's example
> is now different after gggqG, even when using vim-latex's
> 'indentexpr', but it looks good.
As far as I digged into it, the start of a paragraph is indented based
on what comes before. In a "center" section it gets a bit more indent,
the rest of the paragraph too. Before the change, the first line of the
paragraph kept the indent, while following lines were indented a bit
more. Same for the second paragraph. That resulted in the strange
result where the first line of a paragraph wasn't indented.
After the last change, when starting the formatting just before the
first paragraph, all lines of the paragraphs are indented. If starting
on the first line, then that line keeps its indent. If the user wants
to have auto-indent for that line too, then it should be indented with
"==" first. If you want the behavior of after patch 8.2.3615 you could
add a mapping for "gq" to "==gq".
--
Contrary to popular belief, it's often your clothing that gets promoted, not
you.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211207122431.9DB591C0C39%40moolenaar.net.