From 54cd24f12d19385b244ef027268ccd49e89f360b Mon Sep 17 00:00:00 2001 From: Jay Anderson Date: Sat, 17 May 2008 16:16:37 -0700 Subject: [PATCH] Minor fixes for vim syntax highlighting. --- buildscripts/lilypond-words.py | 2 +- vim/lilypond-syntax.vim | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/buildscripts/lilypond-words.py b/buildscripts/lilypond-words.py index 123041b..eacece2 100755 --- a/buildscripts/lilypond-words.py +++ b/buildscripts/lilypond-words.py @@ -39,7 +39,7 @@ for name in ['ly/chord-modifiers-init.ly', 'ly/declarations-init.ly', 'ly/params-init.ly']: s = open (name, 'r').read () - keywords += [w for w in re.findall (r"(?m)^\s*([a-zA-Z]+)\s*=", s)] + keywords += [w for w in re.findall (r"(?m)^\s*\"?([a-zA-Z]+)\"?\s*=", s)] # note names for name in ['ly/catalan.ly', diff --git a/vim/lilypond-syntax.vim b/vim/lilypond-syntax.vim index 9808176..7d0a6d8 100644 --- a/vim/lilypond-syntax.vim +++ b/vim/lilypond-syntax.vim @@ -33,7 +33,7 @@ setlocal mps+=<:> " Case matters syn case match -syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilyEquation,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyReservedWord +syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilyEquation,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyArticulation,lilyReservedWord syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[<>]" end="}" address@hidden fold syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" address@hidden fold @@ -48,6 +48,9 @@ syn match lilyEquation "\(#['`]\)\?\(\a*[-]\)*\a*\s*=\s*\(#[#'`]\?\)\?\a*" syn match lilySlur "[(~)]" syn match lilySlur "\\[()]" syn match lilySpecial "\\[\\]" +" avoid highlighting the extra character in situations like +" c--\mf c^^\mf c__\mf +syn match lilyArticulation "[-_^][-_^+|>.]" " Rest of syntax highlighting rules start here " @@ -68,6 +71,7 @@ if version >= 508 || !exists("did_lily_syn_inits") HiLink lilyComment Comment HiLink lilyNote Identifier + HiLink lilyArticulation PreProc HiLink lilyKeyword Keyword HiLink lilyReservedWord Type -- 1.5.4.3