annotate runtime/syntax/colortest.vim @ 22049:2b04c5bf4dc3 v8.2.1574

patch 8.2.1574: Vim9: glob() doesnot take "true" as argument Commit: https://github.com/vim/vim/commit/5892ea151197c8a6363c7ce2322d84277b97353e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 2 21:53:11 2020 +0200 patch 8.2.1574: Vim9: glob() doesnot take "true" as argument Problem: Vim9: glob() doesnot take "true" as argument. Solution: Use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6821)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Sep 2020 22:00:05 +0200
parents 82b5078be2dd
children 4027cefc2aab
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Contributors: Rafael Garcia-Suarez, Charles Campbell
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
4 " Last Change: 2008 Jun 04
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " edit this file, then do ":source %", and check if the colors match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " black black_on_white white_on_black
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " black_on_black black_on_black
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " darkred darkred_on_white white_on_darkred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " darkred_on_black black_on_darkred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " darkgreen darkgreen_on_white white_on_darkgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " darkgreen_on_black black_on_darkgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " brown brown_on_white white_on_brown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " brown_on_black black_on_brown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " darkblue darkblue_on_white white_on_darkblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " darkblue_on_black black_on_darkblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " darkmagenta darkmagenta_on_white white_on_darkmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " darkmagenta_on_black black_on_darkmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " darkcyan darkcyan_on_white white_on_darkcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " darkcyan_on_black black_on_darkcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " lightgray lightgray_on_white white_on_lightgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " lightgray_on_black black_on_lightgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " darkgray darkgray_on_white white_on_darkgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " darkgray_on_black black_on_darkgray
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " red red_on_white white_on_red
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " red_on_black black_on_red
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " green green_on_white white_on_green
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " green_on_black black_on_green
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " yellow yellow_on_white white_on_yellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " yellow_on_black black_on_yellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " blue blue_on_white white_on_blue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " blue_on_black black_on_blue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " magenta magenta_on_white white_on_magenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " magenta_on_black black_on_magenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " cyan cyan_on_white white_on_cyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " cyan_on_black black_on_cyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " white white_on_white white_on_white
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " white_on_black black_on_white
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " grey grey_on_white white_on_grey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " grey_on_black black_on_grey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " lightred lightred_on_white white_on_lightred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " lightred_on_black black_on_lightred
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " lightgreen lightgreen_on_white white_on_lightgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " lightgreen_on_black black_on_lightgreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " lightyellow lightyellow_on_white white_on_lightyellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " lightyellow_on_black black_on_lightyellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " lightblue lightblue_on_white white_on_lightblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " lightblue_on_black black_on_lightblue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " lightmagenta lightmagenta_on_white white_on_lightmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " lightmagenta_on_black black_on_lightmagenta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " lightcyan lightcyan_on_white white_on_lightcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " lightcyan_on_black black_on_lightcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
671
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
55 " Open this file in a window if it isn't edited yet.
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
56 " Use the current window if it's empty.
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
57 if expand('%:p') != expand('<sfile>:p')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
58 let s:fname = expand('<sfile>')
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
59 if exists('*fnameescape')
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
60 let s:fname = fnameescape(s:fname)
677
e649c78407e6 updated for version 7.0202
vimboss
parents: 671
diff changeset
61 else
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
62 let s:fname = escape(s:fname, ' \|')
677
e649c78407e6 updated for version 7.0202
vimboss
parents: 671
diff changeset
63 endif
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
64 if &mod || line('$') != 1 || getline(1) != ''
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
65 exe "new " . s:fname
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
66 else
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
67 exe "edit " . s:fname
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
68 endif
82b5078be2dd updated for version 7.2a
vimboss
parents: 677
diff changeset
69 unlet s:fname
671
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
70 endif
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
71
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 while search("_on_", "W") < 55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let col1 = substitute(expand("<cword>"), '\(\a\+\)_on_\a\+', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 let col2 = substitute(expand("<cword>"), '\a\+_on_\(\a\+\)', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 endwhile
671
83a006f81bac updated for version 7.0199
vimboss
parents: 7
diff changeset
80 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
81 nohlsearch