jcollard / elm-mode

Elm mode for emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad indentation when editing elm file

YievCkim opened this issue · comments

commented

When I am editing an elm file in elm mode. Elm-mode does not indent the text properly.

By example this (which is obtained at the beginning just after hitting enter at the end of the previous line) :

        case x of
            Just something -> 
                    Html.button
                        [ HtmlE.onClick Msg
                        , HtmlA.class "a_class"
                        ]
                    [ Html.text something ]

Hitting tab do that:

        case x of
            Just something -> 
                    Html.button
                        [ HtmlE.onClick Msg
                        , HtmlA.class "a_class"
                        ]
            [ Html.text something ]

or that:

        case x of
            Just something -> 
                    Html.button
                        [ HtmlE.onClick Msg
                        , HtmlA.class "a_class"
                        ]
        [ Html.text something ]

But never this:

        case x of
            Just something -> 
                    Html.button
                        [ HtmlE.onClick Msg
                        , HtmlA.class "a_class"
                        ]
                        [ Html.text something ]

Which is what is excepted and what elm-format does.
It's a bit annoying to use elm-format every time for that.