diff --git a/haskell-indentation.el b/haskell-indentation.el index d2e79a18c..d3d76c381 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -1358,6 +1358,8 @@ line." (if (or (looking-at "'\\([^\\']\\|\\\\.\\)'") (looking-at "'\\\\\\([^\\']\\|\\\\.\\)*'") (looking-at "\"\\([^\\\"]\\|\\\\.\\)*\"") + ;; QuasiQuotes, with help of propertize buffer and string delimeters + (looking-at "\\s\"\\S\"*\\s\"") ;; Hierarchical names always start with uppercase (looking-at "[[:upper:]]\\(\\s_\\|\\sw\\|'\\)*\\(\\.\\(\\s_\\|\\sw\\|'\\)+\\)*") diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index f3cdac3a4..57c79d621 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -25,6 +25,7 @@ (require 'cl-lib) (require 'ert) (require 'haskell-mode) +(require 'haskell-font-lock) (require 'haskell-indentation) ;;; Code: @@ -70,6 +71,7 @@ because it helps increase coverage." (haskell-indentation-mode 1) (insert source) (newline) + (font-lock-fontify-buffer) (goto-char (point-min)) (forward-line (1- line)) (move-to-column column) @@ -589,5 +591,18 @@ function (Operation 'Init) = do " ((2 0) 2)) +(hindent-test "29a quasiquote single line" " +test = [randomQQ| This is a quasiquote with the word in |] + +" + ((2 0) 0 7)) + +(hindent-test "29b quasiquote multiple lines" " +test = [randomQQ| This is + a quasiquote + with the word in |] + +" + ((4 0) 0 7)) ;;; haskell-indentation-tests.el ends here