Bug#863910: haskell highlighting colors lines starting with # operator in red

James McCoy jamessan at debian.org
Fri Jun 2 03:34:37 UTC 2017


On Thu, Jun 01, 2017 at 04:37:26PM -0400, Joey Hess wrote:
> This in foo.hs will show the problem when loaded in vim with
> no local ~/.vimrc or ~/.vim:
> 
> main = print (munge "world hello,")
> 
> munge = words
>         # reverse
>         # unwords
> 
> (#) = flip (.)
> 

According to ":help ft-haskell-syntax", this seems to be an intentional
trade-off.

  The Haskell syntax highlighting also highlights C preprocessor
  directives, and flags lines that start with # but are not valid
  directives as erroneous.  This interferes with Haskell's syntax for
  operators, as they may start with #.  If you want to highlight those
  as operators as opposed to errors, put in your .vimrc: >
  	:let hs_allow_hash_operator = 1

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB



More information about the pkg-vim-maintainers mailing list