runtime(java): Consent to HTML tags folding in Javadoc comments

HTML tags in Javadoc comments can additionally be folded
after applying
------------------------------------------------------------
	let g:html_syntax_folding = 1
	set foldmethod=syntax
------------------------------------------------------------

and giving explicit consent with
------------------------------------------------------------
	let g:java_consent_to_html_syntax_folding = 1
------------------------------------------------------------

Do not default to this kind of folding unless ALL start tags
and optional end tags are balanced in Javadoc comments;
otherwise, put up with creating runaway folds that break
syntax highlighting.

resolves: zzzyxwvut/java-vim#8.
closes: #17216

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Aliaksei Budavei
2025-04-28 17:58:22 +02:00
committed by Christian Brabandt
parent e3302cf2b1
commit 910bfd5d38
7 changed files with 43 additions and 16 deletions

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 19
*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -2175,6 +2175,13 @@ line for any comments written in this way, and showing the contents of a first
line otherwise, with >
:let g:java_foldtext_show_first_or_second_line = 1
HTML tags in Javadoc comments can additionally be folded by following the
instructions listed under |html-folding| and giving explicit consent with >
:let g:java_consent_to_html_syntax_folding = 1
Do not default to this kind of folding unless ALL start tags and optional end
tags are balanced in Javadoc comments; otherwise, put up with creating runaway
folds that break syntax highlighting.
Trailing whitespace characters or a run of space characters before a tab
character can be marked as an error with >
:let g:java_space_errors = 1