vim2hs icon indicating copy to clipboard operation
vim2hs copied to clipboard

Infix operators incorrectly highlighted

Open danr opened this issue 12 years ago • 2 comments

Infix operators without spaces on both sides are not highlighted:

apa = x++x ++x++ x

Infix constructors are not highlighted:

bepa = 1 :+: 1

Or is highlighted as hsDelimiter:

cepa = 1||1 || 1

(|) is also highlighted as hsDelimiter, but I don't think there is such a delimiter in Haskell.

danr avatar Aug 11 '13 20:08 danr

Infix operators without spaces on both sides are not highlighted

This is known. I haven't found any way to reliably handle unspaced operators and HSP at the same time.

Infix constructors are not highlighted

Hm! That's a good point. We don't actually highlight data constructors at all (intentionally) but since we do distinguish operators and prefix functions maybe infix constructors should have some highlighting group too.

(|) is also highlighted as hsDelimiter, but I don't think there is such a delimiter in Haskell.

Depends what one means by "delimiter" I guess. The standard syntax groups in Vim are mostly tailored for C and some other common languages. It's hard to decide what groups to use for Haskell syntax items! The pipe of course is what's used for algebraic data type definitions and for guards.

Or is highlighted as hsDelimiter

Should maybe add some patterns around that regex for negative matching of operator characters... It's so hairy! Haskell syntax is crazy and Vim's syntax engine so stupid. :cry:

dag avatar Aug 11 '13 20:08 dag

screen shot 2015-07-06 at 8 50 49 pm

Is there any way to highlight based on the backticks? And maybe you could check from the type annotation above, where it says the function name, so Vim knows that that is the correct word to highlight.

evanrelf avatar Jul 07 '15 04:07 evanrelf