From a346df98e728091c921ee01b861fbd650642450d Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Tue, 25 Oct 2011 09:56:54 -0700 Subject: [PATCH 1/2] Ensures Haskell's leftAlt isn't part of lexeme. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the report(s): An ordinary comment begins with a sequence of two or more consecutive dashes (e.g. --) and extends to the following newline. The sequence of dashes must not form part of a legal lexeme. For example, “-->” or “|--” do not begin a comment, because both of these are legal lexemes; however “--foo” does start a comment. Haskell98: http://goo.gl/CucLL Haskell2010: http://goo.gl/1OYzN --- plugin/NERD_commenter.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 6cb7dbe..589dfe2 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -179,7 +179,7 @@ let s:delimiterMap = { \ 'groovy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'gsp': { 'left': '<%--', 'right': '--%>', 'leftAlt': ''}, \ 'gtkrc': { 'left': '#' }, - \ 'haskell': { 'left': '{-','right': '-}', 'leftAlt': '--' }, + \ 'haskell': { 'left': '{-','right': '-}', 'leftAlt': '-- ' }, \ 'hb': { 'left': '#' }, \ 'h': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'haml': { 'left': '-#', 'leftAlt': '/' }, From d5fed4daffa50305160d0b6afab250cfa5c1d26d Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Tue, 25 Oct 2011 10:02:03 -0700 Subject: [PATCH 2/2] Adds support for literate Haskell. Since literate code has anti-comments this might be a hack, but it works well enough. :) --- plugin/NERD_commenter.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 589dfe2..b6fc27b 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -211,6 +211,7 @@ let s:delimiterMap = { \ 'lace': { 'left': '--' }, \ 'ldif': { 'left': '#' }, \ 'less': { 'left': '/*','right': '*/' }, + \ 'lhaskell': { 'left': '>{-','right': '-}', 'leftAlt': '>-- ' }, \ 'lilo': { 'left': '#' }, \ 'lilypond': { 'left': '%' }, \ 'liquid': { 'left': '{% comment %}', 'right': '{% endcomment %}' },