typescript-vim
typescript-vim copied to clipboard
Negative floats are not matched correctly.
In negative floats like -2.5 and -2.004E7, the decimal is not highlighted as part of the number. This is because there is no word boundary before '-', but a word boundary is expected. Here is a suggested fix, where the typescriptFloat pattern expects a word boundary after '-' instead of before it.
diff --git a/syntax/typescript.vim b/syntax/typescript.vim
index 4abaeed..1635dd4 100644
--- a/syntax/typescript.vim
+++ b/syntax/typescript.vim
@@ -72,7 +72,7 @@ syn region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[g
" syntax region typescriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=typescriptSpecial,@htmlPreproc
" syntax region typescriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=typescriptSpecial,@htmlPreproc oneline
" syntax match typescriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
-syntax match typescriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
+syntax match typescriptFloat /-\=\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
" syntax match typescriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
syn match typescriptDecorators /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
Thanks for the patch! I'll get that applied.
Still seeing this after a Vundle :PluginUpdate