lhs syntax highlighting in vim

Hello, The syntax highlighting file for literate haskell in vim says that its maintainer is haskell-cafe@haskell.org, so hopefully one of you will find this relevant. In literate haskell files, vim optionally highlights the non-code text according to TeX markup. The syntax highlighting file looks for key phrases (e.g., "\documentclass") to decide whether to use TeX markup highlighting; but it (erroneously, in my opinion, and at variance with the documentation) will use TeX markup highlighting on any lhs file that contains the '%' character anywhere in it. The bug is in line 74 of version 1.01 of the lhaskell.vim syntax highlighting file. Thanks, Eric

On Wed, Jun 11, 2008 at 01:23:58AM +0100, Eric Stansifer wrote:
The syntax highlighting file for literate haskell in vim says that its maintainer is haskell-cafe@haskell.org, so hopefully one of you will find this relevant.
In literate haskell files, vim optionally highlights the non-code text according to TeX markup. The syntax highlighting file looks for key phrases (e.g., "\documentclass") to decide whether to use TeX markup highlighting; but it (erroneously, in my opinion, and at variance with the documentation) will use TeX markup highlighting on any lhs file that contains the '%' character anywhere in it. The bug is in line 74 of version 1.01 of the lhaskell.vim syntax highlighting file.
I agree that this is wrong. It used to only look at the first 20 lines, so we were covering the case where a TeX file began with some TeX comments. We'd also look for ^\s*%, rather than a % anywhere. If we are going to look at the whole file then checking for comments isn't necessary. Thanks Ian

On 11 jun 2008, at 12:29, Ian Lynagh wrote:
On Wed, Jun 11, 2008 at 01:23:58AM +0100, Eric Stansifer wrote:
The syntax highlighting file for literate haskell in vim says that its maintainer is haskell-cafe@haskell.org, so hopefully one of you will find this relevant.
In literate haskell files, vim optionally highlights the non-code text according to TeX markup. The syntax highlighting file looks for key phrases (e.g., "\documentclass") to decide whether to use TeX markup highlighting; but it (erroneously, in my opinion, and at variance with the documentation) will use TeX markup highlighting on any lhs file that contains the '%' character anywhere in it. The bug is in line 74 of version 1.01 of the lhaskell.vim syntax highlighting file.
I agree that this is wrong. It used to only look at the first 20 lines, so we were covering the case where a TeX file began with some TeX comments. We'd also look for ^\s*%, rather than a % anywhere. If we are going to look at the whole file then checking for comments isn't necessary.
Unfortunately that scan is not necesarily compatible with people dynamically turning on syntax highlighting. But just searching for % is *dead* wrong, I fully agree. I've modified the search code and submitted a patch to the Vim maintainers. With kind regards, Arthur van Leeuwen. -- /\ / | arthurvl@cs.uu.nl | Work like you don't need the money /__\ / | A friend is someone with whom | Love like you have never been hurt / \/__ | you can dare to be yourself | Dance like there's nobody watching
participants (3)
-
Arthur van Leeuwen
-
Eric Stansifer
-
Ian Lynagh