File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -603,11 +603,18 @@ the current buffer."
603603 (while (not (bobp ))
604604 (forward-comment (- (buffer-size )))
605605 (beginning-of-line )
606- (let ((ps (nth 8 (syntax-ppss ))))
607- (when ps ; ; inside comment or string
608- (goto-char ps)))
609- (when (= 0 (haskell-indentation-current-indentation))
610- (throw 'return nil ))))
606+ (let* ((ps (syntax-ppss ))
607+ (start-of-comment-or-string (nth 8 ps))
608+ (start-of-list-expression (nth 1 ps)))
609+ (cond
610+ (start-of-comment-or-string
611+ ; ; inside comment or string
612+ (goto-char start-of-comment-or-string))
613+ (start-of-list-expression
614+ ; ; inside a parenthesized expression
615+ (goto-char start-of-list-expression))
616+ ((= 0 (haskell-indentation-current-indentation))
617+ (throw 'return nil ))))))
611618 (beginning-of-line )
612619 (when (bobp )
613620 (forward-comment (buffer-size )))))
Original file line number Diff line number Diff line change @@ -625,12 +625,14 @@ foo = ()
625625 ((4 0 ) 0 ))
626626
627627
628- (hindent-test " 34* beginning of line inside parentheses" "
628+ (hindent-test " 34 beginning of line inside parentheses" "
629629data T = T {
630630 foo :: String
631631, bar :: String
632632}
633633
634634"
635- ((5 0 ) 0 ))
635+ ; ; set of answers isn't best but it is not a bug
636+ ; ; should be just 0
637+ ((5 0 ) 0 9 ))
636638; ;; haskell-indentation-tests.el ends here
You can’t perform that action at this time.
0 commit comments