changeset 36296:4106acc8fb31 draft

runtime(java): Define javaBlockStart and javaBlockOtherStart hl groups Commit: https://github.com/vim/vim/commit/05d0893ed8d991ed3fa23da7c7d4efe6ffd58798 Author: Aliaksei Budavei <0x000c70@gmail.com> Date: Sat Oct 12 17:12:51 2024 +0200 runtime(java): Define javaBlockStart and javaBlockOtherStart hl groups And do not link either to any group. Resolves zzzyxwvut/java-vim#2. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 12 Oct 2024 17:15:05 +0200
parents d4ac33a37ad8
children 74465717c201
files runtime/syntax/java.vim runtime/syntax/testdir/dumps/java_annotations_04.dump runtime/syntax/testdir/dumps/java_enfoldment_00.dump runtime/syntax/testdir/dumps/java_enfoldment_01.dump runtime/syntax/testdir/dumps/java_enfoldment_02.dump runtime/syntax/testdir/dumps/java_unfoldment_00.dump runtime/syntax/testdir/dumps/java_unfoldment_01.dump runtime/syntax/testdir/dumps/java_unfoldment_02.dump runtime/syntax/testdir/dumps/java_unfoldment_03.dump runtime/syntax/testdir/dumps/java_unfoldment_04.dump runtime/syntax/testdir/dumps/java_unfoldment_05.dump runtime/syntax/testdir/dumps/java_unfoldment_06.dump runtime/syntax/testdir/dumps/java_unfoldment_07.dump runtime/syntax/testdir/input/java_enfoldment.java runtime/syntax/testdir/input/java_unfoldment.java
diffstat 15 files changed, 214 insertions(+), 121 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
 " Maintainer:		Aliaksei Budavei <0x000c70 AT gmail DOT com>
 " Former Maintainer:	Claudio Fleiner <claudio@fleiner.com>
 " Repository:		https://github.com/zzzyxwvut/java-vim.git
-" Last Change:		2024 Oct 03
+" Last Change:		2024 Oct 10
 
 " Please check ":help java.vim" for comments on some of the options
 " available.
@@ -724,10 +724,15 @@ if exists("g:java_highlight_debug")
   hi def link DebugType			Type
 endif
 
+" Complement javaBlock and javaInParen for highlighting.
+syn region javaBlockOther transparent matchgroup=javaBlockOtherStart start="{" end="}"
+
 " Try not to fold top-level-type bodies under assumption that there is
 " but one such body.
-exec 'syn region javaBlock transparent start="\%(^\|^\S[^:]\+\)\@' . s:ff.Peek('120', '') . '<!{" end="}" fold'
+exec 'syn region javaBlock transparent matchgroup=javaBlockStart start="\%(^\|^\S[^:]\+\)\@' . s:ff.Peek('120', '') . '<!{" end="}" fold'
 
+" See "D.2.1 Anonymous Classes" at
+" https://web.archive.org/web/20010821025330/java.sun.com/docs/books/jls/first_edition/html/1.1Update.html#12959.
 if exists("g:java_mark_braces_in_parens_as_errors")
   syn match javaInParen contained "[{}]"
   hi def link javaInParen javaError
--- a/runtime/syntax/testdir/dumps/java_annotations_04.dump
+++ b/runtime/syntax/testdir/dumps/java_annotations_04.dump
@@ -4,7 +4,7 @@
 | +0#00e0e07&@7|@+0#e000e06&|L|a|b|e|l|(|/+0#0000e05&@1| |v|a|l|u|e| |=| |"|P|a|r|a|m|e|t|e|r|"|,| +0#0000000&@36
 | +0#00e0e07&@11|t|y|p|e| |=| |A|n@1|o|t|a|t|i|o|n|s|T|e|s|t|s|.|c+0#00e0003&|l|a|s@1|,+0#00e0e07&| +0#0000000&@32
 | +0#00e0e07&@11>h|e|a|d| |=| |@+0#e000e06&|T|a|g|(|v+0#00e0e07&|a|l|u|e| |=| |"+0#e000002&|@|L|a|b|e|l|"|)+0#e000e06&|,+0#00e0e07&| +0#0000000&@32
-| +0#00e0e07&@11|t|e|x|t| |=| |@+0#e000e06&|T|e|x|t|(|{+0#00e0e07&| |"+0#e000002&|)|{|"|,+0#00e0e07&| |"+0#e000002&|}|(|"| +0#00e0e07&|}|)+0#e000e06&@1| +0#0000000&@33
+| +0#00e0e07&@11|t|e|x|t| |=| |@+0#e000e06&|T|e|x|t|(|{+0#0000000&| +0#00e0e07&|"+0#e000002&|)|{|"|,+0#00e0e07&| |"+0#e000002&|}|(|"| +0#00e0e07&|}+0#0000000&|)+0#e000e06&@1| +0#0000000&@33
 | +0#00e0e07&@7|O|b|j|e|c|t| |d|u|m@1|y|)| +0#0000000&@53
 @4|{| @69
 @4|}| @69
--- a/runtime/syntax/testdir/dumps/java_enfoldment_00.dump
+++ b/runtime/syntax/testdir/dumps/java_enfoldment_00.dump
@@ -1,20 +1,20 @@
 | +0#0000e05#a8a8a8255@1>/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l|o|c|a|l| |f|o|l|d|e|n|a|b|l|e| |f|o|l|d|c|o|l|u|m|n|=|2| |f|o|l|d|m|e|t|h|o|d|=|s|y|n|t|a|x| +0#0000000&@4
 | +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|j|a|v|a|_|f|o|l|d|t|e|x|t|_|s|h|o|w|_|f|i|r|s|t|_|o|r|_|s|e|c|o|n|d|_|l|i|n|e| |=| |1| +0#0000000&@5
+| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j|a|v|a|B|l|o|c|k|O|t|h|e|r|S|t|a|r|t| |S|t|r|u|c|t|u|r|e| +0#0000000&@10
+| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j|a|v|a|B|l|o|c|k|S|t|a|r|t| |T|o|d|o| +0#0000000&@20
 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
-|++0#0000e05#a8a8a8255| |+|-@1| |1|6| |l|i|n|e|s|:| |@|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(|{|-@39
-| @1|c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|F|o|l|d|i|n|g|T|e|s|t|s| |{| @52
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| |1|9| |l|i|n|e|s|:| |@|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(|{|-@39
+| @1|c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|F|o|l|d|i|n|g|T|e|s|t|s| |{+0#00e0003&| +0#0000000&@52
 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|F|o|l|d|e|n|a|b|l|e| @48
 |++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |{|-@57
 | @1| +0#0000000#ffffff0@72
 |++0#0000e05#a8a8a8255| |+|-@1| |1|9| |l|i|n|e|s|:| |s|t|a|t|i|c| |{|-@50
 | @1| +0#0000000#ffffff0@72
-| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| |O|b|j|e|c|t| |b@1| |=| |(@1|O|b|j|e|c|t|)| |n+0#af5f00255&|e|w| +0#0000000&|b+0#00e0003&|y|t|e|[+0#0000000&|]|{|}|)|;| |}| @28
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{+0#0000001#ffff4012| +0#0000000#ffffff0|O|b|j|e|c|t| |b@1| |=| |(@1|O|b|j|e|c|t|)| |n+0#af5f00255&|e|w| +0#0000000&|b+0#00e0003&|y|t|e|[+0#0000000&|]|{+0#0000001#ffff4012|}|)+0#0000000#ffffff0|;| |}+0#0000001#ffff4012| +0#0000000#ffffff0@28
 |++0#0000e05#a8a8a8255| |+|-@1| @1|8| |l|i|n|e|s|:| |{|-@57
-| @1|/+0&#ffffff0|*|\@2|*|/| +0#0000000&|{| @63
+| @1|/+0&#ffffff0|*|\@2|*|/| +0#0000000&|{+0#00e0003&| +0#0000000&@63
 |++0#0000e05#a8a8a8255| |+|-@1| @1|5| |l|i|n|e|s|:| |(|n|e|w| |j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{|-@6
 |+| |+|-@1| @1|5| |l|i|n|e|s|:| |(|n|e|w| |j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{|-@6
-| @1| +0#0000000#ffffff0@3|}| @67
-| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
-|++0#0000e05#a8a8a8255| |+|-@1| @1|3| |l|i|n|e|s|:| @2|*| |N|o| |o|p|e|r|a|t|i|o|n|.|-@41
-| @1| +0#0000000#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|1|(|)| |{| |}| @52
+| @1| +0#0000000#ffffff0@3|}+0#00e0003&| +0#0000000&@67
 @57|1|,|1| @10|T|o|p| 
--- a/runtime/syntax/testdir/dumps/java_enfoldment_01.dump
+++ b/runtime/syntax/testdir/dumps/java_enfoldment_01.dump
@@ -1,9 +1,12 @@
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{+0#0000001#ffff4012| +0#0000000#ffffff0|O|b|j|e|c|t| |b@1| |=| |(@1|O|b|j|e|c|t|)| |n+0#af5f00255&|e|w| +0#0000000&|b+0#00e0003&|y|t|e|[+0#0000000&|]|{+0#0000001#ffff4012|}|)+0#0000000#ffffff0|;| |}+0#0000001#ffff4012| +0#0000000#ffffff0@28
+|++0#0000e05#a8a8a8255| |+|-@1| @1|8| |l|i|n|e|s|:| |{|-@57
+| @1|/+0&#ffffff0|*|\@2|*|/| +0#0000000&|{+0#00e0003&| +0#0000000&@63
 |++0#0000e05#a8a8a8255| |+|-@1| @1|5| |l|i|n|e|s|:| |(|n|e|w| |j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{|-@6
 |+| |+|-@1| @1|5| |l|i|n|e|s|:| |(|n|e|w| |j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{|-@6
-| @1| +0#0000000#ffffff0@3|}| @67
+| @1| +0#0000000#ffffff0@3>}+0#00e0003&| +0#0000000&@67
 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
 |++0#0000e05#a8a8a8255| |+|-@1| @1|3| |l|i|n|e|s|:| @2|*| |N|o| |o|p|e|r|a|t|i|o|n|.|-@41
-| @1| +0#0000000#ffffff0@3>v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|1|(|)| |{| |}| @52
+| @1| +0#0000000#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|1|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0|}+0#0000001#ffff4012| +0#0000000#ffffff0@52
 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000e05&|*|/| +0#0000000&@48
 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|2|(|)| @56
 |++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |{|-@57
@@ -11,10 +14,7 @@
 |++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |v|o|i|d| |n|o|O|p|3|(|)| |{|-@44
 | @1| +0#0000000#ffffff0@3|/+0#0000e05&|*@1| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000e05&|*|/| +0#0000000&@48
 |++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |v|o|i|d| |n|o|O|p|4|(|)| |{|-@44
-| @1|}+0#0000000#ffffff0| @71
-| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
-|++0#0000e05#a8a8a8255| |+|-@1| @1|5| |l|i|n|e|s|:| @1|*| |S|o|m|e| |n|o|t|e|.|-@45
-|+| |+|-@1| @1|5| |l|i|n|e|s|:| @1|*| |A| |s|u|m@1|a|r|y|.|-@45
-| @1|/+0&#ffffff0@1| +0#0000000&@70
-| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |{| +0#0000000&@68
-@57|7|0|,|2|-|5| @7|9|3|%| 
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|3| |l|i|n|e|s|:| |/| |N|o| |o|p|e|r|a|t|i|o|n|.|-@43
+| @1| +0#0000000#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|5|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0|}+0#0000001#ffff4012| +0#0000000#ffffff0@52
+@57|7|1|,|2|-|5| @7|6|1|%| 
--- a/runtime/syntax/testdir/dumps/java_enfoldment_02.dump
+++ b/runtime/syntax/testdir/dumps/java_enfoldment_02.dump
@@ -1,20 +1,20 @@
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|5|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0|}+0#0000001#ffff4012| +0#0000000#ffffff0@52
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@51
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|6|(|)| @56
+|++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |{|-@57
+| @1| +0#0000000#ffffff0@3|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@51
+|++0#0000e05#a8a8a8255| >+|-@1| @1|2| |l|i|n|e|s|:| |v|o|i|d| |n|o|O|p|7|(|)| |{|-@44
+| @1| +0#0000000#ffffff0@3|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@51
+|++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |v|o|i|d| |n|o|O|p|8|(|)| |{|-@44
+| @1|}+0#00e0003#ffffff0| +0#0000000&@71
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|5| |l|i|n|e|s|:| @1|*| |S|o|m|e| |n|o|t|e|.|-@45
+|+| |+|-@1| @1|5| |l|i|n|e|s|:| @1|*| |A| |s|u|m@1|a|r|y|.|-@45
+|+| |+|-@1| @1|3| |l|i|n|e|s|:| |/| |A| |s|u|m@1|a|r|y|.|-@46
+| @1|/+0&#ffffff0@1| +0#0000000&@70
 | +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |{| +0#0000000&@68
 | +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |}| +0#0000000&@68
 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
-|++0#0000e05#a8a8a8255| >+|-@1| @1|2| |l|i|n|e|s|:| |1|2@1|||.@54
+|++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |1|2@1|||.@54
 |~+0#4040ff13#ffffff0| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|9|8|,|1| @9|B|o|t| 
+| +0#0000000&@56|9|7|,|2|-|1| @7|B|o|t| 
--- a/runtime/syntax/testdir/dumps/java_unfoldment_00.dump
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_00.dump
@@ -1,7 +1,10 @@
 >/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l|o|c|a|l| |n|o|f|o|l|d|e|n|a|b|l|e| +0#0000000&@35
 |/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|j|a|v|a|_|m|a|r|k|_|b|r|a|c|e|s|_|i|n|_|p|a|r|e|n|s|_|a|s|_|e|r@1|o|r|s| |=| |1| +0#0000000&@10
+|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j|a|v|a|B|l|o|c|k|O|t|h|e|r|S|t|a|r|t| |S|t|r|u|c|t|u|r|e| +0#0000000&@12
+|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j|a|v|a|B|l|o|c|k|S|t|a|r|t| |T|o|d|o| +0#0000000&@22
 @75
-@4|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(|{+0#0000000&| @51
+@75
+@4|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(|{+0#0000001#ffff4012| +0#0000000#ffffff0@51
 @4|"@2| @67
 | +0#e000002&@3|b|e|s|p|o|k|e| +0#0000000&@63
 | +0#e000002&@3|/|*| +0#0000000&@68
@@ -10,11 +13,8 @@
 | +0#e000002&@3|/|*@1| +0#0000000&@67
 | +0#e000002&@4|*| +0#0000000&@68
 | +0#e000002&@4|*|/| +0#0000000&@67
-| +0#e000002&@3|/@1| +0#0000000&@68
-| +0#e000002&@3|/@1| +0#0000000&@68
+| +0#e000002&@3|/@2| +0#0000000&@67
+| +0#e000002&@3|/@2| +0#0000000&@67
+| +0#e000002&@3|/@2| +0#0000000&@67
 | +0#e000002&@3|/@1| +0#0000000&@68
-| +0#e000002&@3|{| +0#0000000&@69
-| +0#e000002&@3|}| +0#0000000&@69
-|"@2| @71
-|}|)+0#e000e06&| +0#0000000&@72
 @57|1|,|1| @10|T|o|p| 
--- a/runtime/syntax/testdir/dumps/java_unfoldment_01.dump
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_01.dump
@@ -1,20 +1,20 @@
-| +0#e000002#ffffff0@3|/@1| +0#0000000&@68
+| +0#e000002#ffffff0@4|*| +0#0000000&@68
+| +0#e000002&@4|*|/| +0#0000000&@67
+| +0#e000002&@3|/@2| +0#0000000&@67
+| +0#e000002&@3|/@2| +0#0000000&@67
+| +0#e000002&@3|/@2| +0#0000000&@67
+| +0#e000002&@3>/@1| +0#0000000&@68
+| +0#e000002&@3|/@1| +0#0000000&@68
 | +0#e000002&@3|/@1| +0#0000000&@68
 | +0#e000002&@3|{| +0#0000000&@69
 | +0#e000002&@3|}| +0#0000000&@69
 |"@2| @71
->}|)+0#e000e06&| +0#0000000&@72
-|c+0#00e0003&|l|a|s@1| +0#0000000&|U|n|f|o|l|d|i|n|g|T|e|s|t|s| |{| @52
+|}+0#0000001#ffff4012|)+0#e000e06#ffffff0| +0#0000000&@72
+|c+0#00e0003&|l|a|s@1| +0#0000000&|U|n|f|o|l|d|i|n|g|T|e|s|t|s| |{+0#00e0003&| +0#0000000&@52
 @4|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|U|n|f|o|l|d|e|n|a|b|l|e| @48
-@4|{| @69
-@4|}| @69
+@4|{+0#0000001#ffff4012| +0#0000000#ffffff0@69
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
 @75
-@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|{| @62
-@8|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{| @52
-@12|{| @61
-@16|{| @57
-@20|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{@2| @38
-@24|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{@2|}@2|;| @30
-@20|}@2|;| @50
-@16|}| @57
-@57|1|9|,|1| @9|1|6|%| 
+@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|{+0#0000001#ffff4012| +0#0000000#ffffff0@62
+@8|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0@52
+@57|1|9|,|2|-|5| @7|1|2|%| 
--- a/runtime/syntax/testdir/dumps/java_unfoldment_02.dump
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_02.dump
@@ -1,20 +1,20 @@
-| +0&#ffffff0@15|}| @57
-@12|}| @61
-@8|}|;| @64
+| +0&#ffffff0@7|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0@52
+@12|{+0#0000001#ffff4012| +0#0000000#ffffff0@61
+@16|{+0#0000001#ffff4012| +0#0000000#ffffff0@57
+@20|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{+0#0000001#ffff4012@2| +0#0000000#ffffff0@38
+@24|n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)| |{+0#0000001#ffff4012@2|}@2|;+0#0000000#ffffff0| @30
+@20>}+0#0000001#ffff4012@2|;+0#0000000#ffffff0| @50
+@16|}+0#0000001#ffff4012| +0#0000000#ffffff0@57
+@12|}+0#0000001#ffff4012| +0#0000000#ffffff0@61
+@8|}+0#0000001#ffff4012|;+0#0000000#ffffff0| @64
 @75
-@8|s+0#af5f00255&|w|i|t|c|h| +0#0000000&|(|0+0#e000002&|)+0#0000000&| |{| @54
-@12>c+0#af5f00255&|a|s|e| +0#0000000&|0+0#e000002&|:+0#0000000&| @55
-@12|c+0#af5f00255&|a|s|e| +0#0000000&|1+0#e000002&|:+0#0000000&| |{| @53
+@8|s+0#af5f00255&|w|i|t|c|h| +0#0000000&|(|0+0#e000002&|)+0#0000000&| |{+0#0000001#ffff4012| +0#0000000#ffffff0@54
+@12|c+0#af5f00255&|a|s|e| +0#0000000&|0+0#e000002&|:+0#0000000&| @55
+@12|c+0#af5f00255&|a|s|e| +0#0000000&|1+0#e000002&|:+0#0000000&| |{+0#0000001#ffff4012| +0#0000000#ffffff0@53
 @16|b+0#af5f00255&|r|e|a|k|;+0#0000000&| @52
-@12|}| @61
+@12|}+0#0000001#ffff4012| +0#0000000#ffffff0@61
 @12|d+0#af5f00255&|e|f|a|u|l|t|:+0#0000000&| |;| @52
-@8|}| @65
-@4|}| @69
+@8|}+0#0000001#ffff4012| +0#0000000#ffffff0@65
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
 @75
-@4|{| |O|b|j|e|c|t| |b@1| |=| |(@1|O|b|j|e|c|t|)| |n+0#af5f00255&|e|w| +0#0000000&|b+0#00e0003&|y|t|e|[+0#0000000&|]|{+0#ffffff16#ff404010|}|)+0#0000000#ffffff0|;| |}| @30
-@4|{| @69
-|o+0#af5f00255&|u|t|:+0#0000000&| |{| @68
-@8|d+0#af5f00255&|o| +0#0000000&|{| @62
-@12|i+0#af5f00255&|f| +0#0000000&|(|t+0#e000002&|r|u|e|)+0#0000000&| @53
-@16|b+0#af5f00255&|r|e|a|k| +0#0000000&|o+0#af5f00255&|u|t|;+0#0000000&| @48
-@57|3|7|,|4|-|1|3| @6|3|9|%| 
+@57|3|7|,|6|-|2|1| @6|3|0|%| 
--- a/runtime/syntax/testdir/dumps/java_unfoldment_03.dump
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_03.dump
@@ -1,9 +1,15 @@
-| +0&#ffffff0@15|b+0#af5f00255&|r|e|a|k| +0#0000000&|o+0#af5f00255&|u|t|;+0#0000000&| @48
-@8|}| |w+0#af5f00255&|h|i|l|e| +0#0000000&|(|f+0#e000002&|a|l|s|e|)+0#0000000&|;| @50
-|}| @73
-@4|}| @69
-|/+0#0000e05&|*|\@2|*|/| +0#0000000&|{| @65
-@8>(|n+0#af5f00255&|e|w| +0#0000000&|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{+0#ffffff16#ff404010| +0#0000000#ffffff0@14
+| +0&#ffffff0@74
+@4|{+0#0000001#ffff4012| +0#0000000#ffffff0|O|b|j|e|c|t| |b@1| |=| |(@1|O|b|j|e|c|t|)| |n+0#af5f00255&|e|w| +0#0000000&|b+0#00e0003&|y|t|e|[+0#0000000&|]|{+0#ffffff16#ff404010|}|)+0#0000000#ffffff0|;| |}+0#0000001#ffff4012| +0#0000000#ffffff0@30
+@4|{+0#0000001#ffff4012| +0#0000000#ffffff0@69
+|o+0#af5f00255&|u|t|:+0#0000000&| |{+0#0000001#ffff4012| +0#0000000#ffffff0@68
+@8|d+0#af5f00255&|o| +0#0000000&|{+0#0000001#ffff4012| +0#0000000#ffffff0@62
+@12>i+0#af5f00255&|f| +0#0000000&|(|t+0#e000002&|r|u|e|)+0#0000000&| @53
+@16|b+0#af5f00255&|r|e|a|k| +0#0000000&|o+0#af5f00255&|u|t|;+0#0000000&| @48
+@8|}+0#0000001#ffff4012| +0#0000000#ffffff0|w+0#af5f00255&|h|i|l|e| +0#0000000&|(|f+0#e000002&|a|l|s|e|)+0#0000000&|;| @50
+|}+0#0000001#ffff4012| +0#0000000#ffffff0@73
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
+|/+0#0000e05&|*|\@2|*|/| +0#0000000&|{+0#00e0003&| +0#0000000&@65
+@8|(|n+0#af5f00255&|e|w| +0#0000000&|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{+0#ffffff16#ff404010| +0#0000000#ffffff0@14
 @12|/+0#0000e05&|*@1| +0#0000000&@59
 | +0#0000e05&@12|*| +0#e000e06&|{|@|i|n|h|e|r|i|t|D|o|c|}| |*+0#0000e05&|/| +0#0000000&@43
 @12|p+0#00e0003&|u|b|l|i|c| +0#0000000&|O|b|j|e|c|t| |a|p@1|l|y|(|O|b|j|e|c|t| |o|)| |{+0#ffffff16#ff404010| +0#0000000#ffffff0|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|o|;| |}+0#ffffff16#ff404010|;+0#0000000#ffffff0| @18
@@ -11,10 +17,4 @@
 @8|(|n+0#af5f00255&|e|w| +0#0000000&|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|O|b|j|e|c|t|,| |O|b|j|e|c|t|>|(|)| |{+0#ffffff16#ff404010| +0#0000000#ffffff0@14
 @12|/+0#0000e05&|*@1| +0#e000e06&|{|@|i|n|h|e|r|i|t|D|o|c|}| +0#0000000&@45
 | +0#e000e06&@12|*+0#0000e05&|/| +0#0000000&@59
-@12|p+0#00e0003&|u|b|l|i|c| +0#0000000&|O|b|j|e|c|t| |a|p@1|l|y|(|O|b|j|e|c|t| |o|)| |{+0#ffffff16#ff404010| +0#0000000#ffffff0|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|o|;| |}+0#ffffff16#ff404010|;+0#0000000#ffffff0| @18
-@8|}+0#ffffff16#ff404010|)+0#0000000#ffffff0@1|;| @62
-@4|}| @69
-@75
-@4|/+0#0000e05&|*@1| +0#0000000&@67
-| +0#0000e05&@4|*| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@54
-@57|5@1|,|3|-|9| @7|6|2|%| 
+@57|5@1|,|4|-|1|3| @6|4|7|%| 
--- a/runtime/syntax/testdir/dumps/java_unfoldment_04.dump
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_04.dump
@@ -1,20 +1,20 @@
-| +0#0000e05#ffffff0@4|*| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@54
+| +0#e000e06#ffffff0@12|*+0#0000e05&|/| +0#0000000&@59
+@12|p+0#00e0003&|u|b|l|i|c| +0#0000000&|O|b|j|e|c|t| |a|p@1|l|y|(|O|b|j|e|c|t| |o|)| |{+0#ffffff16#ff404010| +0#0000000#ffffff0|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|o|;| |}+0#ffffff16#ff404010|;+0#0000000#ffffff0| @18
+@8|}+0#ffffff16#ff404010|)+0#0000000#ffffff0@1|;| @62
+@4|}+0#00e0003&| +0#0000000&@69
+@75
+@4>/+0#0000e05&|*@1| +0#0000000&@67
+| +0#0000e05&@4|*| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@54
 | +0#0000e05&@4|*|/| +0#0000000&@67
-@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|1|(|)| |{| |}| @54
+@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|1|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0|}+0#0000001#ffff4012| +0#0000000#ffffff0@54
 @4|/+0#0000e05&|*@1| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000e05&|*|/| +0#0000000&@50
 @4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|2|(|)| @58
-@4>{| @69
-@4|}| @69
-@4|/+0#0000e05&|*@1| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000e05&|*|/| +0#0000000&@50
-@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|3|(|)| |{| @56
-@4|}| @69
+@4|{+0#0000001#ffff4012| +0#0000000#ffffff0@69
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
 @4|/+0#0000e05&|*@1| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000e05&|*|/| +0#0000000&@50
-@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|4|(|)| |{| @56
-@4|/+0#0000e05&|*|/|\|/|\|/|\|*|/| +0#0000000&|;| |}| @56
-|}| @73
-@75
-|/+0#0000e05&|*| +0#0000000&@72
-| +0#0000e05&|*| |S|o|m|e| |n|o|t|e|.| +0#0000000&@61
-| +0#0000e05&|*| |{| +0#0000000&@70
-| +0#0000e05&|*| |}| +0#0000000&@70
-@57|7|3|,|2|-|5| @7|8|4|%| 
+@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|3|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0@56
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
+@4|/+0#0000e05&|*@1| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000e05&|*|/| +0#0000000&@50
+@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|4|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0@56
+@4|/+0#0000e05&|*|/|\|/|\|/|\|*|/| +0#0000000&|;| |}+0#0000001#ffff4012| +0#0000000#ffffff0@56
+@57|7|3|,|2|-|5| @7|6|5|%| 
--- a/runtime/syntax/testdir/dumps/java_unfoldment_05.dump
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_05.dump
@@ -1,20 +1,20 @@
-| +0#0000e05#ffffff0|*| |}| +0#0000000&@70
-| +0#0000e05&|*|/| +0#0000000&@71
-|/+0#0000e05&|*@1| +0#0000000&@71
-| +0#0000e05&|*| +0#e000e06&|A| |s|u|m@1|a|r|y|.| +0#0000000&@61
-| +0#0000e05&|*| |{| +0#0000000&@70
-| +0#0000e05&>*| |}| +0#0000000&@70
-| +0#0000e05&|*|/| +0#0000000&@71
-|/+0#0000e05&@1| +0#0000000&@72
-|/+0#0000e05&@1| |{| +0#0000000&@70
-|/+0#0000e05&@1| |}| +0#0000000&@70
+| +0&#ffffff0@3|/+0#0000e05&|*|/|\|/|\|/|\|*|/| +0#0000000&|;| |}+0#0000001#ffff4012| +0#0000000#ffffff0@56
 @75
-|/+0#0000e05&|*| |1|2@1|||.@67
-@20|*|/| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|U|n|f|o|l|d|e|n|a|b|l|e| |{| @27
-|}| @73
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|9|1|,|2| @9|B|o|t| 
+@4|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@53
+| +0#0000e05&@3|/@2| +0#0000000&@67
+| +0#0000e05&@3|/@2| +0#0000000&@67
+@4>v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|5|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0|}+0#0000001#ffff4012| +0#0000000#ffffff0@54
+@4|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@53
+@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|6|(|)| @58
+@4|{+0#0000001#ffff4012| +0#0000000#ffffff0@69
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
+@4|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@53
+@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|7|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0@56
+@4|}+0#0000001#ffff4012| +0#0000000#ffffff0@69
+@4|/+0#0000e05&@2| +0#e000e06&|N|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@53
+@4|v+0#00e0003&|o|i|d| +0#0000000&|n|o|O|p|8|(|)| |{+0#0000001#ffff4012| +0#0000000#ffffff0@56
+@4|/+0#0000e05&|*|/|\|/|\|/|\|*|/| +0#0000000&|;| |}+0#0000001#ffff4012| +0#0000000#ffffff0@56
+|}+0#00e0003&| +0#0000000&@73
+@75
+|/+0#0000e05&|*| +0#0000000&@72
+@57|9|1|,|2|-|5| @7|8|2|%| 
new file mode 100644
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_06.dump
@@ -0,0 +1,20 @@
+|/+0#0000e05#ffffff0|*| +0#0000000&@72
+| +0#0000e05&|*| |S|o|m|e| |n|o|t|e|.| +0#0000000&@61
+| +0#0000e05&|*| |{| +0#0000000&@70
+| +0#0000e05&|*| |}| +0#0000000&@70
+| +0#0000e05&|*|/| +0#0000000&@71
+>/+0#0000e05&|*@1| +0#0000000&@71
+| +0#0000e05&|*| +0#e000e06&|A| |s|u|m@1|a|r|y|.| +0#0000000&@61
+| +0#0000e05&|*| |{| +0#0000000&@70
+| +0#0000e05&|*| |}| +0#0000000&@70
+| +0#0000e05&|*|/| +0#0000000&@71
+|/+0#0000e05&@2| +0#e000e06&|A| |s|u|m@1|a|r|y|.| +0#0000000&@60
+|/+0#0000e05&@2| +0#0000000&|{+0#0000e05&| +0#0000000&@69
+|/+0#0000e05&@2| +0#0000000&|}+0#0000e05&| +0#0000000&@69
+|/+0#0000e05&@1| +0#0000000&@72
+|/+0#0000e05&@1| |{| +0#0000000&@70
+|/+0#0000e05&@1| |}| +0#0000000&@70
+@75
+|/+0#0000e05&|*| |1|2@1|||.@67
+@20|*|/| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|U|n|f|o|l|d|e|n|a|b|l|e| |{+0#0000001#ffff4012| +0#0000000#ffffff0@27
+@57|1|0|9|,|1| @8|9@1|%| 
new file mode 100644
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/java_unfoldment_07.dump
@@ -0,0 +1,20 @@
+|/+0#0000e05#ffffff0|*| |1|2@1|||.@67
+@20|*|/| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|U|n|f|o|l|d|e|n|a|b|l|e| |{+0#0000001#ffff4012| +0#0000000#ffffff0@27
+>}+0#0000001#ffff4012| +0#0000000#ffffff0@73
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|2@1|,|1| @8|B|o|t| 
--- a/runtime/syntax/testdir/input/java_enfoldment.java
+++ b/runtime/syntax/testdir/input/java_enfoldment.java
@@ -1,5 +1,8 @@
 // VIM_TEST_SETUP setlocal foldenable foldcolumn=2 foldmethod=syntax
 // VIM_TEST_SETUP let g:java_foldtext_show_first_or_second_line = 1
+// VIM_TEST_SETUP highlight link javaBlockOtherStart Structure
+// VIM_TEST_SETUP highlight link javaBlockStart Todo
+
 
 	@SuppressWarnings({
 	"""
@@ -10,6 +13,9 @@
 	/**
 	 *
 	 */
+	///
+	///
+	///
 	//
 	//
 	//
@@ -78,6 +84,21 @@ out: {
 	/** No operation. */
 	void noOp4() {
 	/*/\/\/\*/ ; }
+
+	/// No operation.
+	///
+	///
+	void noOp5() { }
+	/// No operation.
+	void noOp6()
+	{
+	}
+	/// No operation.
+	void noOp7() {
+	}
+	/// No operation.
+	void noOp8() {
+	/*/\/\/\*/ ; }
 }
 
 /*
@@ -90,6 +111,9 @@ out: {
  * {
  * }
  */
+/// A summary.
+/// {
+/// }
 //
 // {
 // }
--- a/runtime/syntax/testdir/input/java_unfoldment.java
+++ b/runtime/syntax/testdir/input/java_unfoldment.java
@@ -1,5 +1,8 @@
 // VIM_TEST_SETUP setlocal nofoldenable
 // VIM_TEST_SETUP let g:java_mark_braces_in_parens_as_errors = 1
+// VIM_TEST_SETUP highlight link javaBlockOtherStart Structure
+// VIM_TEST_SETUP highlight link javaBlockStart Todo
+
 
 	@SuppressWarnings({
 	"""
@@ -10,6 +13,9 @@
 	/**
 	 *
 	 */
+	///
+	///
+	///
 	//
 	//
 	//
@@ -78,6 +84,21 @@ out: {
 	/** No operation. */
 	void noOp4() {
 	/*/\/\/\*/ ; }
+
+	/// No operation.
+	///
+	///
+	void noOp5() { }
+	/// No operation.
+	void noOp6()
+	{
+	}
+	/// No operation.
+	void noOp7() {
+	}
+	/// No operation.
+	void noOp8() {
+	/*/\/\/\*/ ; }
 }
 
 /*
@@ -90,6 +111,9 @@ out: {
  * {
  * }
  */
+/// A summary.
+/// {
+/// }
 //
 // {
 // }