Mercurial > vim
comparison runtime/syntax/xpm.vim @ 32590:635de73eeb4c
Update runtime files
Commit: https://github.com/vim/vim/commit/10e8ff9b26078994cae57c2422b145d37aaf714e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 10 21:40:39 2023 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Jun 2023 22:45:05 +0200 |
parents | 2a17771529af |
children | 448aef880252 |
comparison
equal
deleted
inserted
replaced
32589:47f101f21004 | 32590:635de73eeb4c |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: X Pixmap | 2 " Language: X Pixmap |
3 " Maintainer: Ronald Schild <rs@scutum.de> | 3 " Maintainer: Ronald Schild <rs@scutum.de> |
4 " Last Change: 2023 May 11 | 4 " Last Change: 2023 May 24 |
5 " Version: 5.4n.2 | 5 " Version: 5.4n.2 |
6 " Jemma Nelson added termguicolors support | 6 " Jemma Nelson added termguicolors support |
7 " Dominique Pellé fixed spelling support | 7 " Dominique Pellé fixed spelling support |
8 " Christian J. Robinson fixed use of global variables, moved | 8 " Christian J. Robinson fixed use of global variables, moved |
9 " loop into a compiled function | 9 " loop into a compiled function |
40 if n == 0 # first string is the Values string | 40 if n == 0 # first string is the Values string |
41 | 41 |
42 var values = split(s[1 : -2]) | 42 var values = split(s[1 : -2]) |
43 | 43 |
44 # Values string invalid, bail out | 44 # Values string invalid, bail out |
45 if len(values) != 4 | 45 if len(values) != 4 && len(values) != 6 && len(values) != 7 |
46 return | 46 return |
47 endif | 47 endif |
48 | 48 |
49 # get the 3rd value: colors = number of colors | 49 # get the 3rd value: colors = number of colors |
50 colors = str2nr(values[2]) | 50 colors = str2nr(values[2]) |
98 elseif color =~ '#\x\{3}$' | 98 elseif color =~ '#\x\{3}$' |
99 color = substitute(color, '\(\x\)\(\x\)\(\x\)', '0\10\20\3', '') | 99 color = substitute(color, '\(\x\)\(\x\)\(\x\)', '0\10\20\3', '') |
100 endif | 100 endif |
101 | 101 |
102 # escape meta characters in patterns | 102 # escape meta characters in patterns |
103 s = escape(s, '/\*^$.~[] ') | 103 s = escape(s, '/\*^$.~[]') |
104 chars = escape(chars, '/\*^$.~[] ') | 104 chars = escape(chars, '/\*^$.~[]') |
105 | 105 |
106 # now create syntax items | 106 # now create syntax items |
107 # highlight the color string as normal string (no pixel string) | 107 # highlight the color string as normal string (no pixel string) |
108 exe 'syn match xpmCol' .. n .. 'Def /' .. s .. '/ contains=xpmCol' .. n .. 'inDef' | 108 exe 'syn match xpmCol' .. n .. 'Def /' .. s .. '/ contains=xpmCol' .. n .. 'inDef' |
109 exe 'hi link xpmCol' .. n .. 'Def String' | 109 exe 'hi link xpmCol' .. n .. 'Def String' |