the following sequence seems to help (tested on 
ghc/compiler/stranal/StrictAnal.lhs):

:syn sync fromstart
:syn region texZone matchgroup=hsLineComment start="\\begin{code}" end="\\end{code}" [EMAIL PROTECTED] keepend matchgroup=NONE

i'll leave it to those who are actually using literate haskell to
check this and to have it included in lhaskell.vim if it is helpful.

claus

----- Original Message ----- From: "Claus Reinke" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, June 05, 2007 1:28 PM
Subject: literate haskell syntax highlighting issues in vim (Re:[Haskell-cafe] OK,so this VIM thing -- how do I make it actually work?)


   clearly.)  The problems I'm seeing are the ugly white-on-red for
   underlines, the lack of any kind of differentiation for
You can also put your cursor an those underlines and use

 :echo synIDattr(synID(line("."), col("."), 1), "name")

looks like a highlighting bug alright. reduced example:

------------------------ H.lhs:

% \section{one}

\begin{code}
data D_e = D String deriving Show
\end{code}

% \section{two}

data D_e = D String deriving Show

------------------------ as it is, the first code line is haskell-highlighted, the "_" is part of a "ConId"; the second code line is tex-highlighted, the "_" becomes a "texOnlyMath", and is highlighted as a syntax error (red).

if i uncomment the "\section{one}", haskell-highlighting disappears,
everything is now part of a "texSectionZone", and highlighted as
such, including tex syntax error highlights.
if i now register code-sections as "texZone" (the zone "tex.vim" uses for "verbatim"), with haskell contents, both code lines are
haskell-highlighted, so the "texSectionZone" has been interrupted..

:syn region texZone start="\\begin{code}" end="\\end{code}" [EMAIL PROTECTED]

if i now uncomment the "\section{two}", a new "texSectionZone"
is started there (might need a resync), and both code lines are highlighted correctly (the first as haskell, the second as -buggy- tex).

"tex.vim" has several zones with no real end marker ("\section",
"\chapter", ..), and it seems that "tex.vim" and "lhaskell.vim" do
not interact properly.
since this list is given as the maintainer for "lhaskell.vim": any literate haskellers out here who'd like to try fixing that?-)

claus


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to