neovimhaskell / haskell-vim

Custom Haskell Vimscripts
BSD 2-Clause "Simplified" License
681 stars 84 forks source link

align | with = in data declaration #103

Closed qwfy closed 6 years ago

qwfy commented 6 years ago

issue fixed: when &shiftwidth /= g:haskell_indent_guard, say &shiftwidth=4 and g:haskell_indent_guard=2, press enter after the "Bar" in

data Foo
    = Bar

and type "| Baz" will result

data Foo
    = Bar
  | Baz

which is not we want, this commit fixes this, type "| Baz" after "Bar" will now result

data Foo
    = Bar
    | Baz
raichoo commented 6 years ago

Huh, this is odd. The behavior this patch seems to introduce is already working for me. Are you sure this is broken and not some edge case in your editor setup?

qwfy commented 6 years ago

Did another test with a clean setup, and it is indeed caused by other setups, but I cannot identify which one.

This patch combined with that unknown factor gives the correct behaviour in my setup. Disable everything else but this plugin (this patched version) also gives the incorrect behaviour :-(

raichoo commented 6 years ago

Bummer, thanks for the effort though!