runtime(java): Manage byte limits for variable-width lookbehind assertions

Raise the byte limits from 80 to 120 for "javaFuncDef" and
"java*CommentTitle"; and support selecting other arbitrary
values with
------------------------------------------------------------
	let g:java_lookbehind_byte_counts = {
		\ 'javaMarkdownCommentTitle': 240,
	\ }
------------------------------------------------------------

for related groups of syntax definitions, referring to their
names with dictionary keys.

Over-80-Byte-Limit Lookbehind Examples:
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/java.base/share/classes/sun/security/x509/NamedX509Key.java [Lines 43 & 44]
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/jdk.compiler/share/classes/com/sun/tools/javac/util/GraphUtils.java [Line 154]

closes: #17921

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Aliaksei Budavei
2025-08-08 10:50:19 +02:00
committed by Christian Brabandt
parent adfea9b4e6
commit 7132935413
10 changed files with 75 additions and 28 deletions

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2025 Aug 07
*syntax.txt* For Vim version 9.1. Last change: 2025 Aug 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -2231,6 +2231,15 @@ Certain modifiers are incompatible with each other, e.g. `abstract` and
and can be differently highlighted as a group than other modifiers with >
:hi link javaConceptKind NonText
All instances of variable-width lookbehind assertions (|/\@<!| and |/\@<=|),
resorted to in syntax item definitions, are confined to arbitrary byte counts.
Another arbitrary value can be selected for a related group of definitions.
For example: >
:let g:java_lookbehind_byte_counts = {'javaMarkdownCommentTitle': 240}
Where each key name of this dictionary is the name of a syntax item. The use
of these assertions in syntax items may vary among revisions, so no definitive
set of supported key names is committed to.
If you notice highlighting errors while scrolling backwards, which are fixed
when redrawing with CTRL-L, try setting the "g:java_minlines" variable to
a larger number: >