Skip to content

Autoindent sometimes indents too much #137

@mcandre

Description

@mcandre

I sometimes have to comment out (turn-on-haskell-indentation) in my .emacs, as the current implementation sometimes indents too far deeply. This occurs at the first character of function signatures, for example, if the cursor is on the f in fibber :: Int -> Int:

#!/usr/bin/env runhaskell

fibber :: Int -> Int
fibber 0 = 0
fibber 1 = 1
fibber n = fibber (n - 1) + fibber (n - 2)

main :: IO ()
main = print $ fibber 20

Then pressing Tab there results in:

#!/usr/bin/env runhaskell

  fibber :: Int -> Int
fibber 0 = 0
fibber 1 = 1
fibber n = fibber (n - 1) + fibber (n - 2)

main :: IO ()
main = print $ fibber 20

A similar error happens with the cursor beginning on the empty line between the shebang and the signature; pressing Tab results in improper indentation being inserted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions