neovimhaskell / haskell-vim

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

Indentation of guards on where functions is wrong #104

Closed kevinkjt2000 closed 6 years ago

kevinkjt2000 commented 6 years ago

What the plugin does automatically:

countGarbageChars :: String -> Integer
countGarbageChars "" = 0
countGarbageChars (x:xs)
  | x == '<' = countUntilClosed xs
  | x == '!' = countGarbageChars (drop 1 xs)
  | otherwise = countGarbageChars xs
  where countUntilClosed (x:xs)
        | x == '>' = 0
        | x == '!' = countUntilClosed (drop 1 xs)
        | otherwise = 1 + countUntilClosed xs

What ghc expects:

countGarbageChars :: String -> Integer
countGarbageChars "" = 0
countGarbageChars (x:xs)
  | x == '<' = countUntilClosed xs
  | x == '!' = countGarbageChars (drop 1 xs)
  | otherwise = countGarbageChars xs
  where countUntilClosed (x:xs)
          | x == '>' = 0
          | x == '!' = countUntilClosed (drop 1 xs)
          | otherwise = 1 + countUntilClosed xs

nvim --version

NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +jemalloc +tui

I only had w0rp/ale and this plugin loaded to reproduce the issue.

raichoo commented 6 years ago

Thanks for reporting. This should be fixed now.