hindent 3.5 → 3.6
raw patch · 3 files changed
+26/−33 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- elisp/hindent.el +24/−31
- hindent.cabal +1/−1
- src/HIndent/Styles/JohanTibell.hs +1/−1
elisp/hindent.el view
@@ -92,42 +92,35 @@ (or (looking-at "^-}$") (looking-at "^{-$"))) nil)- ((bound-and-true-p structured-haskell-repl-mode)- (case major-mode- (haskell-interactive-mode- ;; If the prompt start is available.- (when (boundp 'haskell-interactive-mode-prompt-start)- ;; Unless we're running code.- (unless (> (point)- (save-excursion (goto-char haskell-interactive-mode-prompt-start)- (line-end-position)))- ;; When we're within the prompt and not on some output lines or whatever.- (when (and (>= (point) haskell-interactive-mode-prompt-start)- (not (= haskell-interactive-mode-prompt-start- (line-end-position))))- (let ((whole-line (buffer-substring-no-properties- haskell-interactive-mode-prompt-start- (line-end-position))))- ;; Don't activate if we're doing a GHCi command.- (unless (string-match "^:" whole-line)- (cons haskell-interactive-mode-prompt-start- (line-end-position)))))))- ))) ;; Otherwise we just do our line-based hack. (t (save-excursion- (let ((start (or (progn (goto-char (line-end-position))- (search-backward-regexp "^[^ \n]" nil t 1)- (unless (or (looking-at "^-}$")- (looking-at "^{-$"))- (point)))+ (let ((start (or (flet+ ((jump ()+ (search-backward-regexp "^[^ \n]" nil t 1)+ (cond+ ((save-excursion (goto-char (line-beginning-position))+ (looking-at "|]"))+ (jump))+ (t (unless (or (looking-at "^-}$")+ (looking-at "^{-$"))+ (point))))))+ (goto-char (line-end-position))+ (jump)) 0)) (end (progn (goto-char (1+ (point)))- (or (when (search-forward-regexp "[\n]+[^ \n]" nil t 1)- (forward-char -1)- (search-backward-regexp "[^\n ]" nil t)- (forward-char)- (point))+ (or (flet+ ((jump ()+ (when (search-forward-regexp "[\n]+[^ \n]" nil t 1)+ (cond+ ((save-excursion (goto-char (line-beginning-position))+ (looking-at "|]"))+ (jump))+ (t (forward-char -1)+ (search-backward-regexp "[^\n ]" nil t)+ (forward-char)+ (point))))))+ (jump)) (point-max))))) (cons start end))))))
hindent.cabal view
@@ -1,5 +1,5 @@ name: hindent-version: 3.5+version: 3.6 synopsis: Extensible Haskell pretty printer description: Extensible Haskell pretty printer. Both a library and an executable. .
src/HIndent/Styles/JohanTibell.hs view
@@ -232,7 +232,6 @@ Nothing -> do pretty pat pretty rhs- indentSpaces <- getIndentSpaces case mbinds of Nothing -> return () Just binds ->@@ -386,5 +385,6 @@ (do depend (write "{") (prefixedLined "," (map (depend space . pretty) fields))+ newline write "} ") recDecl r = prettyNoExt r