From 08f82d84cd199dd40441f11dea7c2a9a9e820812 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 1 Apr 2004 23:06:46 +0000 Subject: [PATCH] Restrict characters allowed in commands -- deals with "\date)." Comments git-svn-id: svn://svn.tartarus.org/sgt/halibut@4033 cda61777-01e9-0310-a592-d414129be87e --- misc/halibut.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/misc/halibut.vim b/misc/halibut.vim index a344306..6443471 100644 --- a/misc/halibut.vim +++ b/misc/halibut.vim @@ -3,7 +3,7 @@ " Maintainer: Jacob Nevins " URL: http://www.chiark.greenend.org.uk/~sgtatham/halibut/ " Filenames: *.but -" Version: $Id: halibut.vim,v 1.5 2004/04/01 22:52:46 jtn Exp $ +" Version: $Id: halibut.vim,v 1.6 2004/04/01 23:06:46 jtn Exp $ " I've never been entirely comfortable with vim's syntax highlighting " facilities, so this may have all sorts of nasty loose ends, corner cases @@ -32,12 +32,15 @@ syn match butIllegalChar "\\" " Simple-minded fallback to highlight any command we don't recognise, " and assume it has textual arguments. -" XXX highlights all of "\date)." -syn match butCmdGeneric "\\\(\S\&[^{}\\]\)\+" nextgroup=butTextArg +" (matches current iscmd() in input.c; there are some oddballs which +" don't fit this handled specially below) +syn match butCmdGeneric "\\[A-Za-z0-9]\+" nextgroup=butTextArg " was: [A-Za-z0-9#]\+ syn cluster butText contains=butLiteral,@butCmd,butTodo +" The special one-character "commands". +" XXX might want to split up? Can all these appear in \k{...}? syn match butLiteral "\\[-{}_.\\]" " This isn't specific to Halibut, but is often useful. -- 2.11.0