diff options
| author | Sergey Tikhomirov <sergey@tikhomirov.io> | 2017-06-20 09:34:18 +0300 |
|---|---|---|
| committer | Sergey Tikhomirov <sergey@tikhomirov.io> | 2017-06-20 09:34:18 +0300 |
| commit | 94fb0b624e0aa5b1c1292fbb9e0b61dbe8cad62b (patch) | |
| tree | 0fc66d327d624b481a3da9de066a87e0c964ff4d | |
| parent | 1cde5643dce9210fa685741bbb282cb9ce09465a (diff) | |
| download | vim-glsl-94fb0b624e0aa5b1c1292fbb9e0b61dbe8cad62b.tar.gz vim-glsl-94fb0b624e0aa5b1c1292fbb9e0b61dbe8cad62b.zip | |
Highlight struct name
| -rw-r--r-- | syntax/glsl.vim | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/syntax/glsl.vim b/syntax/glsl.vim index 2fdded2..6a2fcf1 100644 --- a/syntax/glsl.vim +++ b/syntax/glsl.vim @@ -26,15 +26,15 @@ syn region glslPreProc start="^\s*#\s*\(error\|pragma\|extension\|versi syn keyword glslBoolean true false " Integer Numbers -syn match glslDecimalInt display "\(0\|[1-9]\d*\)[uU]\?" -syn match glslOctalInt display "0\o\+[uU]\?" -syn match glslHexInt display "0[xX]\x\+[uU]\?" +syn match glslDecimalInt display "\<\(0\|[1-9]\d*\)[uU]\?" +syn match glslOctalInt display "\<0\o\+[uU]\?" +syn match glslHexInt display "\<0[xX]\x\+[uU]\?" " Float Numbers -syn match glslFloat display "\d\+\.\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\=" -syn match glslFloat display "\.\d\+\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\=" -syn match glslFloat display "\d\+[eE][+-]\=\d\+\(lf\|LF\|f\|F\)\=" -syn match glslFloat display "\d\+\.\d\+\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\=" +syn match glslFloat display "\<\d\+\.\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\=" +syn match glslFloat display "\<\.\d\+\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\=" +syn match glslFloat display "\<\d\+[eE][+-]\=\d\+\(lf\|LF\|f\|F\)\=" +syn match glslFloat display "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\=" " Swizzles syn match glslSwizzle display /\.[xyzw]\{1,4\}\>/ @@ -42,10 +42,9 @@ syn match glslSwizzle display /\.[rgba]\{1,4\}\>/ syn match glslSwizzle display /\.[stpq]\{1,4\}\>/ " Structure -syn keyword glslStructure struct +syn keyword glslStructure struct nextgroup=glslIdentifier skipwhite skipempty -" This prevents numbers at ends of identifies from being highlighted as numbers -syn match glslIdentifier display "\I\i*" +syn match glslIdentifier contains=glslIdentifierPrime "\%([a-zA-Z_]\)\%([a-zA-Z0-9_]\)*" display contained " Types syn keyword glslType atomic_uint @@ -659,13 +658,15 @@ hi def link glslOctalInt glslInteger hi def link glslHexInt glslInteger hi def link glslInteger Number hi def link glslFloat Float +hi def link glslIdentifierPrime glslIdentifier +hi def link glslIdentifier Identifier hi def link glslStructure Structure hi def link glslType Type hi def link glslQualifier StorageClass hi def link glslBuiltinConstant Constant hi def link glslBuiltinFunction Function hi def link glslBuiltinVariable Identifier -hi def link glslSwizzle SpecialChar +hi def link glslSwizzle Identifier if !exists("b:current_syntax") let b:current_syntax = "glsl" |
