annotate runtime/syntax/colortest.vim @ 34468:f5d114f7440e

runtime(java): Recognise text blocks (#14128) Commit: https://github.com/vim/vim/commit/b3030b653bbdc08c91138001d1987d804f6ebf46 Author: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com> Date: Sun Mar 3 17:51:01 2024 +0300 runtime(java): Recognise text blocks (https://github.com/vim/vim/issues/14128) Also, accept as valid the space escape sequence `\s`. Also, consistently use the claimed `javaDebug` prefix for syntax group definitions kept under `g:java_highlight_debug`. Since `javaStringError` is commented out for its generality, let's comment out `javaDebugStringError`, its copy, as well. References: https://openjdk.org/jeps/378 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Closes #10910. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Mar 2024 16:00:10 +0100
parents 4027cefc2aab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim script for testing colors
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 1621
diff changeset
2 " Maintainer: The Vim Project <https://github.com/vim/vim>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Contributors: Rafael Garcia-Suarez, Charles Campbell
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 1621
diff changeset
4 " Last Change: 2023 Aug 10
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 1621
diff changeset
5 " Former Maintainer: Bram Moolenaar <Bram@vim.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " edit this file, then do ":source %", and check if the colors match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " black black_on_white white_on_black
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " black_on_black black_on_black
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " darkred darkred_on_white white_on_darkred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " darkred_on_black black_on_darkred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " darkgreen darkgreen_on_white white_on_darkgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " darkgreen_on_black black_on_darkgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " brown brown_on_white white_on_brown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " brown_on_black black_on_brown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " darkblue darkblue_on_white white_on_darkblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " darkblue_on_black black_on_darkblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " darkmagenta darkmagenta_on_white white_on_darkmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " darkmagenta_on_black black_on_darkmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " darkcyan darkcyan_on_white white_on_darkcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " darkcyan_on_black black_on_darkcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " lightgray lightgray_on_white white_on_lightgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " lightgray_on_black black_on_lightgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " darkgray darkgray_on_white white_on_darkgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " darkgray_on_black black_on_darkgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " red red_on_white white_on_red
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " red_on_black black_on_red
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " green green_on_white white_on_green
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " green_on_black black_on_green
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " yellow yellow_on_white white_on_yellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " yellow_on_black black_on_yellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " blue blue_on_white white_on_blue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " blue_on_black black_on_blue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " magenta magenta_on_white white_on_magenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " magenta_on_black black_on_magenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " cyan cyan_on_white white_on_cyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " cyan_on_black black_on_cyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " white white_on_white white_on_white
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " white_on_black black_on_white
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " grey grey_on_white white_on_grey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " grey_on_black black_on_grey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " lightred lightred_on_white white_on_lightred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " lightred_on_black black_on_lightred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " lightgreen lightgreen_on_white white_on_lightgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " lightgreen_on_black black_on_lightgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " lightyellow lightyellow_on_white white_on_lightyellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " lightyellow_on_black black_on_lightyellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " lightblue lightblue_on_white white_on_lightblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " lightblue_on_black black_on_lightblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " lightmagenta lightmagenta_on_white white_on_lightmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " lightmagenta_on_black black_on_lightmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " lightcyan lightcyan_on_white white_on_lightcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " lightcyan_on_black black_on_lightcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
671
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
56 " Open this file in a window if it isn't edited yet.
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
57 " Use the current window if it's empty.
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
58 if expand('%:p') != expand('<sfile>:p')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
59 let s:fname = expand('<sfile>')
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
60 if exists('*fnameescape')
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
61 let s:fname = fnameescape(s:fname)
677
e649c78407e6 updated for version 7.0202
vimboss
parents: 671
diff changeset
62 else
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
63 let s:fname = escape(s:fname, ' \|')
677
e649c78407e6 updated for version 7.0202
vimboss
parents: 671
diff changeset
64 endif
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
65 if &mod || line('$') != 1 || getline(1) != ''
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
66 exe "new " . s:fname
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
67 else
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
68 exe "edit " . s:fname
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
69 endif
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
70 unlet s:fname
671
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
71 endif
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
72
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 while search("_on_", "W") < 55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 let col1 = substitute(expand("<cword>"), '\(\a\+\)_on_\a\+', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 let col2 = substitute(expand("<cword>"), '\a\+_on_\(\a\+\)', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 endwhile
671
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
81 8,54g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")| exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 nohlsearch