Mercurial > vim
annotate runtime/syntax/mgl.vim @ 16582:9a7d98e11954 v8.1.1294
patch 8.1.1294: MS-Windows: Some fonts return wrong average char width
commit https://github.com/vim/vim/commit/93d77b2cbec08518ee426d0c44c50cf505732443
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 7 22:52:50 2019 +0200
patch 8.1.1294: MS-Windows: Some fonts return wrong average char width
Problem: MS-Windows: Some fonts return wrong average char width.
Solution: Compute the average ourselves. (Ken Takata, closes https://github.com/vim/vim/issues/4356)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 07 May 2019 23:00:06 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
680 | 1 " Vim syntax file |
2 " Language: MGL | |
3 " Version: 1.0 | |
4 " Last Change: 2006 Feb 21 | |
5 " Maintainer: Gero Kuhlmann <gero@gkminix.han.de> | |
6 " | |
2034 | 7 " $Id: mgl.vim,v 1.1 2006/02/21 22:08:20 vimboss Exp $ |
680 | 8 " |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
9 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
10 if exists("b:current_syntax") |
680 | 11 finish |
12 endif | |
13 | |
14 | |
15 syn sync lines=250 | |
16 | |
17 syn keyword mglBoolean true false | |
18 syn keyword mglConditional if else then | |
19 syn keyword mglConstant nil | |
20 syn keyword mglPredefined maxint | |
21 syn keyword mglLabel case goto label | |
22 syn keyword mglOperator to downto in of with | |
23 syn keyword mglOperator and not or xor div mod | |
24 syn keyword mglRepeat do for repeat while to until | |
25 syn keyword mglStatement procedure function break continue return restart | |
26 syn keyword mglStatement program begin end const var type | |
27 syn keyword mglStruct record | |
28 syn keyword mglType integer string char boolean char ipaddr array | |
29 | |
30 | |
31 " String | |
32 if !exists("mgl_one_line_string") | |
33 syn region mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape | |
34 syn region mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC | |
35 else | |
36 "wrong strings | |
37 syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape | |
38 syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC | |
39 "right strings | |
40 syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape | |
41 syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC | |
42 end | |
43 syn match mglStringEscape contained "''" | |
44 syn match mglStringEscapeGPC contained '""' | |
45 | |
46 | |
47 if exists("mgl_symbol_operator") | |
48 syn match mglSymbolOperator "[+\-/*=\%]" | |
49 syn match mglSymbolOperator "[<>]=\=" | |
50 syn match mglSymbolOperator "<>" | |
51 syn match mglSymbolOperator ":=" | |
52 syn match mglSymbolOperator "[()]" | |
53 syn match mglSymbolOperator "\.\." | |
54 syn match mglMatrixDelimiter "(." | |
55 syn match mglMatrixDelimiter ".)" | |
56 syn match mglMatrixDelimiter "[][]" | |
57 endif | |
58 | |
59 syn match mglNumber "-\=\<\d\+\>" | |
60 syn match mglHexNumber "\$[0-9a-fA-F]\+\>" | |
61 syn match mglCharacter "\#[0-9]\+\>" | |
62 syn match mglIpAddr "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>" | |
63 | |
64 syn region mglComment start="(\*" end="\*)" | |
65 syn region mglComment start="{" end="}" | |
66 syn region mglComment start="//" end="$" | |
67 | |
68 if !exists("mgl_no_functions") | |
69 syn keyword mglFunction dispose new | |
70 syn keyword mglFunction get load print select | |
71 syn keyword mglFunction odd pred succ | |
72 syn keyword mglFunction chr ord abs sqr | |
73 syn keyword mglFunction exit | |
74 syn keyword mglOperator at timeout | |
75 endif | |
76 | |
77 | |
78 syn region mglPreProc start="(\*\$" end="\*)" | |
79 syn region mglPreProc start="{\$" end="}" | |
80 | |
81 syn keyword mglException try except raise | |
82 syn keyword mglPredefined exception | |
83 | |
84 | |
85 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
86 " Only when an item doesn't have highlighting yet |
680 | 87 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
88 hi def link mglBoolean Boolean |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link mglComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link mglConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link mglConstant Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link mglException Exception |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link mglFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link mglLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link mglMatrixDelimiter Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link mglNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link mglHexNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 hi def link mglCharacter Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
99 hi def link mglIpAddr Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
100 hi def link mglOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
101 hi def link mglPredefined mglFunction |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
102 hi def link mglPreProc PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 hi def link mglRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
104 hi def link mglStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
105 hi def link mglString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 hi def link mglStringEscape Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link mglStringEscapeGPC Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
108 hi def link mglStringError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link mglStruct mglStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link mglSymbolOperator mglOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
111 hi def link mglType Type |
680 | 112 |
113 | |
114 | |
115 let b:current_syntax = "mgl" | |
116 | |
117 " vim: ts=8 sw=2 |