Skip to content

Add option g:haskell_indent_let_no_in #98

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

Merged
merged 1 commit into from
Jul 18, 2017

Conversation

jez
Copy link
Contributor

@jez jez commented Jul 14, 2017

This addresses some of the grievances in #85. Namely, we give users the
option to change how indentation works with let statements.

Current behavior:

-- g:haskell_indent_let
let x = 0
>>>>y = 0

let x = 0 in
>>>>x

-- g:haskell_indent_in
let x = 0
>in x

-- ??? (conflated with g:haskell_indent_let)
let x = 0
>>>>x

New behavior:

-- g:haskell_indent_no_in
let x = 0
>>>>x

So for example, those who omit the 'in' on the first line and any 'let'
on the second line can opt to have no indentaton:

--- g:haskell_indent_no_in = 0
let x = 0
fooBar x

Thanks for this project! I really enjoy the new syntax highlighting in
particular. Also, I'm open to suggestions; let me know if you can think of
cases I haven't thought of.

This addresses some of the grievances in neovimhaskell#85. Namely, we give users the
option to change how indentation works with `let` statements.

Current behavior:

    -- g:haskell_indent_let
    let x = 0
    >>>>y = 0

    let x = 0 in
    >>>>x

    -- g:haskell_indent_in
    let x = 0
    >in x

    -- ??? (conflated with g:haskell_indent_let)
    let x = 0
    >>>>x

New behavior:

    -- g:haskell_indent_no_in
    let x = 0
    >>>>x

So for example, those who omit the 'in' on the first line and any 'let'
on the second line can opt to have no indentaton:

    --- g:haskell_indent_no_in = 0
    let x = 0
    fooBar x
@raichoo
Copy link
Member

raichoo commented Jul 14, 2017

Hey, thanks for the PR.

I'm not sure about the second new behavior since it would impact my workflow.

I'm doing this quite a lot and hence would prefer indentation under let.

let x = 1
    y = 2 -- gets indented automatically
 in x + y -- dito

I haven't checked if your PR breaks that but from your description it looks like that (maybe I'm just misinterpreting).

@jez
Copy link
Contributor Author

jez commented Jul 14, 2017 via email

@raichoo
Copy link
Member

raichoo commented Jul 17, 2017

I've merged this into my workstation so I can test drive it for a day. It seems to have passed my test suite so that's a good sign already ^^.

@raichoo raichoo merged commit 21c4876 into neovimhaskell:master Jul 18, 2017
@jez jez deleted the jez/let-no-in branch July 19, 2017 03:36
@jez
Copy link
Contributor Author

jez commented Jul 19, 2017

Thanks for the merge! Great plugin by the way; way ahead of any other Haskell syntax/indentation plugin 😄

@raichoo
Copy link
Member

raichoo commented Jul 19, 2017

Thanks for contributing.

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.

2 participants