Attached is a patch which should make forte dynamic highlighted. It
also fixes this: 'c--\mf'. Normally the second '-' is highlighted with
the \mf which isn't right. Let me know if things seem ok (I've never
submitted a patch before).

-----Jay
From 54cd24f12d19385b244ef027268ccd49e89f360b Mon Sep 17 00:00:00 2001
From: Jay Anderson <[EMAIL PROTECTED]>
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="}"	[EMAIL PROTECTED] fold
 syn region lilyMatcher	matchgroup=Delimiter start="\["		end="]"	[EMAIL PROTECTED] 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

_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to