hindent 3.4 → 3.5
raw patch · 3 files changed
+36/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hindent.cabal +2/−2
- src/HIndent/Pretty.hs +21/−4
- vim/hindent.vim +13/−0
hindent.cabal view
@@ -1,5 +1,5 @@ name: hindent-version: 3.4+version: 3.5 synopsis: Extensible Haskell pretty printer description: Extensible Haskell pretty printer. Both a library and an executable. .@@ -13,7 +13,7 @@ category: Development build-type: Simple cabal-version: >=1.8-data-files: elisp/hindent.el+data-files: elisp/hindent.el vim/hindent.vim library hs-source-dirs: src/
src/HIndent/Pretty.hs view
@@ -832,8 +832,10 @@ error "FIXME: No implementation for InfixA." IParam{} -> error "FIXME: No implementation for IParam."- EqualP{} ->- error "FIXME: No implementation for EqualP."+ EqualP _ a b ->+ do pretty a+ write " ~ "+ pretty b instance Pretty BangType where prettyInternal x =@@ -982,8 +984,23 @@ indented indentSpaces (depend (write "where ") (pretty binds))- InfixMatch{} ->- error "FIXME: No implementation for InfixMatch."+ InfixMatch _ pat1 name pats rhs mbinds ->+ do depend (do pretty pat1+ space+ case name of+ Ident _ i -> string ("`" ++ i ++ "`")+ Symbol _ s -> string s)+ (do space+ spaced (map pretty pats))+ pretty rhs+ case mbinds of+ Nothing -> return ()+ Just binds ->+ do newline+ indentSpaces <- getIndentSpaces+ indented indentSpaces+ (depend (write "where ")+ (pretty binds)) instance Pretty PatField where prettyInternal x =
+ vim/hindent.vim view
@@ -0,0 +1,13 @@+if exists("g:loaded_hindent") || !executable("hindent")+ finish+endif+let g:loaded_hindent = 1++if !exists("g:hindent_style")+ let g:hindent_style = "fundamental"+endif++if has("autocmd")+ let hindent = "hindent --style " . g:hindent_style+ autocmd FileType haskell setlocal formatexpr=FormatprgLocal(hindent)+endif