Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-line comments for Elm #283

Merged
merged 1 commit into from Feb 20, 2017
Merged

Conversation

zack
Copy link
Contributor

@zack zack commented Jan 19, 2017

Technically the minimum necessary syntax for block comments requires
only a single hyphen (-}, {-), but I have found that using a double
hyphen plays a bit more nicely with the elmcast/elm-vim auto-formatting.
Further, uncommenting when using the single dashes leaves an extra level
of indentation (again, when using elmcast/elm-vim).

-- These are PR (not commit) comments:
Vim auto-removed extra whitespace. Let me know and I can remove those line
changes.

Here's an example of this multi-line comment in action and the resulting
auto-format from elmcast/elm-vim:

main : Program Never Model Msg
main =
    Html.program
        { init = ( initialModel, Cmd.none )
        , view = view
        , update = update
        , subscriptions = (\model -> Sub.none)
        }

becomes

{--
  - main : Program Never Model Msg
  - main =
  -     Html.program
  -         { init = ( initialModel, Cmd.none )
  -         , view = view
  -         , update = update
  -         , subscriptions = (\model -> Sub.none)
  -         }
  --}

versus using a single dash:

{-
   - main : Program Never Model Msg
   - main =
   -     Html.program
   -         { init = ( initialModel, Cmd.none )
   -         , view = view
   -         , update = update
   -         , subscriptions = (\model -> Sub.none)
   -         }
-}

Technically the minimum necessary syntax for block comments requires
only a single hyphen (`-}`, `{-`), but I have found that using a double
hyphen plays a bit more nicely with the elmcast/elm-vim auto-formatting.
Further, uncommenting when using the single dashes leaves an extra level
of indentation (again, when using elmcast/elm-vim).
@alerque
Copy link
Member

alerque commented Feb 20, 2017

Thanks for the contribution @zack. Sorry it took me so long to review this, but it looks fine.

@alerque alerque merged commit 59552f2 into preservim:master Feb 20, 2017
harish2704 added a commit to harish2704/nerdcommenter that referenced this pull request Mar 11, 2017
* 'master' of https://github.com/harish2704/nerdcommenter:
  Add support for the meson build system. (preservim#289)
  Add multi-line comments for Elm (preservim#283)
  Fix removing space when uncommenting spaced AltDelims multipart comment (preservim#286)
  Add gitignore support (preservim#284)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants