Allow the user to disable preprocessor directives.

This adds a new global (`g:gasDisablePreproc`) or per-buffer (`gasDisablePreproc`) option to disable the special highlighting applied to CPP preprocessor directives like `#include`, `#if` etc.

fixes #5
This commit is contained in:
René Köcher 2016-03-22 20:19:26 +01:00
parent 0c562e7a52
commit 986cffaffd
1 changed files with 6 additions and 5 deletions

View File

@ -2013,13 +2013,14 @@ call <SID>MapOpcode('gasOpcode_X64_VMX' , 'x64' , 'vmx')
call <SID>MapOpcode('gasOpcode_X86_64_Base' , 'x64' , 'base') call <SID>MapOpcode('gasOpcode_X86_64_Base' , 'x64' , 'base')
" support CPP preprocessor tags " support CPP preprocessor tags
syn case match if !exists('g:gasDisablePreproc') && !exists('b:gasDisablePreproc')
syn case match
syn include @cPP syntax/c.vim syn include @cPP syntax/c.vim
syn match cPPLineCont "\\$" contained syn match cPPLineCont "\\$" contained
syn region cPPPreProc start=/^\s*#\s*\(if\|else\|endif\|define\|include\)/ end=/$/ contains=@cPP,cPPLineCont
syn region cPPPreProc start=/^\s*#\s*\(if\|else\|endif\|define\|include\)/ end=/$/ contains=@cPP,cPPLineCont
endif
" finishing touches " finishing touches
let b:current_syntax = "gas" let b:current_syntax = "gas"