jcollard / elm-mode

Elm mode for emacs
GNU General Public License v3.0
373 stars 67 forks source link

Bad indentation when editing elm file #193

Open YievCkim opened 4 months ago

YievCkim commented 4 months ago

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.