From 986cffaffde3c0b1e16d299a039e64ec2b565c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20K=C3=B6cher?= Date: Tue, 22 Mar 2016 20:19:26 +0100 Subject: [PATCH] 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 --- syntax/gas.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/syntax/gas.vim b/syntax/gas.vim index c936716..b6102cd 100644 --- a/syntax/gas.vim +++ b/syntax/gas.vim @@ -2013,13 +2013,14 @@ call MapOpcode('gasOpcode_X64_VMX' , 'x64' , 'vmx') call MapOpcode('gasOpcode_X86_64_Base' , 'x64' , 'base') " support CPP preprocessor tags -syn case match +if !exists('g:gasDisablePreproc') && !exists('b:gasDisablePreproc') + syn case match -syn include @cPP syntax/c.vim -syn match cPPLineCont "\\$" contained - -syn region cPPPreProc start=/^\s*#\s*\(if\|else\|endif\|define\|include\)/ end=/$/ contains=@cPP,cPPLineCont + syn include @cPP syntax/c.vim + syn match cPPLineCont "\\$" contained + syn region cPPPreProc start=/^\s*#\s*\(if\|else\|endif\|define\|include\)/ end=/$/ contains=@cPP,cPPLineCont +endif " finishing touches let b:current_syntax = "gas"