branch: elpa/haskell-tng-mode commit 89c5c80496d33677e41e875beffdd83d059910ea Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
improve smartparens workaround --- haskell-tng-contrib-smartparens.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/haskell-tng-contrib-smartparens.el b/haskell-tng-contrib-smartparens.el index b34fa07..23d4e29 100644 --- a/haskell-tng-contrib-smartparens.el +++ b/haskell-tng-contrib-smartparens.el @@ -17,10 +17,13 @@ (sp-local-pair 'haskell-tng-mode (car pair) (cdr pair) :post-handlers '(("| " "SPC")))) -;; WORKAROUND smartparens is indenting all the time, which is not good -(defun sp--indent-region (_1 _2 &optional _3) - ;; TODO disable this function just in this mode - ) +;; WORKAROUND smartparens indenting all the time +(defun sp--indent-region (start end &optional column) + (unless (or + (bound-and-true-p haskell-tng-mode) + (bound-and-true-p aggressive-indent-mode)) + (cl-letf (((symbol-function 'message) #'ignore)) + (indent-region start end column)))) (add-hook 'haskell-tng-mode-hook