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

Autoindent inconsistencies #128

Open
GHGibonus opened this issue Sep 11, 2017 · 0 comments · May be fixed by #129
Open

Autoindent inconsistencies #128

GHGibonus opened this issue Sep 11, 2017 · 0 comments · May be fixed by #129

Comments

@GHGibonus
Copy link

While editing a fork of elm-vim, I noticed some unexpected behaviors in the way autoindent works. Notably I found two issues.

  1. else clauses in if expressions do not align with the parent if:
    When I write an if else expression, I expect autoindent to align the else with a parent if, like so:

    fun : Int -> Bool
    fun x =
        if x == 0 then
            False
        else
            True

    Instead, when I type else, else do not align itself with the parent if. I get the following:

    fun : Int -> Bool
    fun x =
        if x == 0 then
            False
            else
                True

    Note that the former is the way let in expressions work and it is reasonable to assume that if else expressions would work the same way.
    This is a non-issue when using a snippet insertion plugin such as UltiSnip. However, having the base indent plugin work is a nice goal to have.

  2. Operators starting a new line do not in indent.
    When using the pipe operator especially, one expects that the line is indented such as:

    fun : List a -> List a
    fun l =
        tail l
            |> reverse
            |> drop 5

    However, what I get is the following:

    fun : List a -> List a
    fun l =
        tail l
        |> reverse
        |> drop 5

Looking at the indent/elm.vim file, I found that those behaviors were intended, but the implementation just do not work.

@GHGibonus GHGibonus linked a pull request Sep 11, 2017 that will close this issue
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 a pull request may close this issue.

1 participant