Mercurial > vim
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 |
rev | line source |
---|---|
7 | 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 | 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 | 6 |
7 " edit this file, then do ":source %", and check if the colors match | |
8 | |
9 " black black_on_white white_on_black | |
10 " black_on_black black_on_black | |
11 " darkred darkred_on_white white_on_darkred | |
12 " darkred_on_black black_on_darkred | |
13 " darkgreen darkgreen_on_white white_on_darkgreen | |
14 " darkgreen_on_black black_on_darkgreen | |
15 " brown brown_on_white white_on_brown | |
16 " brown_on_black black_on_brown | |
17 " darkblue darkblue_on_white white_on_darkblue | |
18 " darkblue_on_black black_on_darkblue | |
19 " darkmagenta darkmagenta_on_white white_on_darkmagenta | |
20 " darkmagenta_on_black black_on_darkmagenta | |
21 " darkcyan darkcyan_on_white white_on_darkcyan | |
22 " darkcyan_on_black black_on_darkcyan | |
23 " lightgray lightgray_on_white white_on_lightgray | |
24 " lightgray_on_black black_on_lightgray | |
25 " darkgray darkgray_on_white white_on_darkgray | |
26 " darkgray_on_black black_on_darkgray | |
27 " red red_on_white white_on_red | |
28 " red_on_black black_on_red | |
29 " green green_on_white white_on_green | |
30 " green_on_black black_on_green | |
31 " yellow yellow_on_white white_on_yellow | |
32 " yellow_on_black black_on_yellow | |
33 " blue blue_on_white white_on_blue | |
34 " blue_on_black black_on_blue | |
35 " magenta magenta_on_white white_on_magenta | |
36 " magenta_on_black black_on_magenta | |
37 " cyan cyan_on_white white_on_cyan | |
38 " cyan_on_black black_on_cyan | |
39 " white white_on_white white_on_white | |
40 " white_on_black black_on_white | |
41 " grey grey_on_white white_on_grey | |
42 " grey_on_black black_on_grey | |
43 " lightred lightred_on_white white_on_lightred | |
44 " lightred_on_black black_on_lightred | |
45 " lightgreen lightgreen_on_white white_on_lightgreen | |
46 " lightgreen_on_black black_on_lightgreen | |
47 " lightyellow lightyellow_on_white white_on_lightyellow | |
48 " lightyellow_on_black black_on_lightyellow | |
49 " lightblue lightblue_on_white white_on_lightblue | |
50 " lightblue_on_black black_on_lightblue | |
51 " lightmagenta lightmagenta_on_white white_on_lightmagenta | |
52 " lightmagenta_on_black black_on_lightmagenta | |
53 " lightcyan lightcyan_on_white white_on_lightcyan | |
54 " lightcyan_on_black black_on_lightcyan | |
55 | |
671 | 56 " Open this file in a window if it isn't edited yet. |
57 " Use the current window if it's empty. | |
58 if expand('%:p') != expand('<sfile>:p') | |
1621 | 59 let s:fname = expand('<sfile>') |
60 if exists('*fnameescape') | |
61 let s:fname = fnameescape(s:fname) | |
677 | 62 else |
1621 | 63 let s:fname = escape(s:fname, ' \|') |
677 | 64 endif |
1621 | 65 if &mod || line('$') != 1 || getline(1) != '' |
66 exe "new " . s:fname | |
67 else | |
68 exe "edit " . s:fname | |
69 endif | |
70 unlet s:fname | |
671 | 71 endif |
72 | |
7 | 73 syn clear |
74 8 | |
75 while search("_on_", "W") < 55 | |
76 let col1 = substitute(expand("<cword>"), '\(\a\+\)_on_\a\+', '\1', "") | |
77 let col2 = substitute(expand("<cword>"), '\a\+_on_\(\a\+\)', '\1', "") | |
78 exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2 | |
79 exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2 | |
80 endwhile | |
671 | 81 8,54g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")| exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>") |
7 | 82 nohlsearch |