Re: Incorrect Prolog syntax highlight in Vim
- Hello Bram,
Can you please include the attached fixed prolog.vim in the
distribution of vim? :-)
Amir Yalon wrote:
> Thomas, hello,I see the problem. Unfortunately, it's not so easy to fix...
> I am addressing you because you are listed in the Vim source file
> the maintainer. I had a short conversation with people on
> #vim@FreeNodeIRC channel, discussing a specific line in that source
> Notice on line 4 how the comment is treated incorrectly as part of the
> The discussion had a consensus that line 31 inThe problem with the hack in Pastey is that it won't work
> be revised, but probably not in the way that Anonymous guy suggested
> in Pastey. Another person suggested adding
> "contains=prologComment,prologCComment" to that line. I have not tried to
> hack into it myself, because I do not know enough about Vim syntax files.
correctly any more with strings in the head - if those strings
contain a ".", for example.
The other suggested solution (adding
contains=prologComment,prologCComment) won't work if said
possible string contains "%" or "/*".
And simply allowing ".%" to end the clause doesn't work either
because it won't highlight the comment as the comment's start
won't be recognized.
So now my fix is to add a space to the end pattern of
prologClauseHead (in the \.[ ] part of the match), which
fixed the case in line 4. Unfortunately, that didn't help in all
cases, so I had to add a "contains=" solution as well. I did it
like this: contains=prologComment,prologCComment,prologString -
that will also allow for strange things like the lines beginning
from line 8 in the screenshot.
> If there is anything I might do to help, please let me know, and I will doI would not be too sad if someone would take over maintenance of
> what I can.
the prolog.vim syntax file, as I haven't coded anything in prolog
since I left university (which was 8 years ago). Other than that,
you can only be patient, as I only read my private email
> Thanks, and best regards,Ciao,
Thomas Köhler Email: jean-luc@...
<>< WWW: http://gott-gehabt.de
PGP public key available from Homepage!