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."
603
603
(while (not (bobp ))
604
604
(forward-comment (- (buffer-size )))
605
605
(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 ))))))
611
618
(beginning-of-line )
612
619
(when (bobp )
613
620
(forward-comment (buffer-size )))))
Original file line number Diff line number Diff line change @@ -625,12 +625,14 @@ foo = ()
625
625
((4 0 ) 0 ))
626
626
627
627
628
- (hindent-test " 34* beginning of line inside parentheses" "
628
+ (hindent-test " 34 beginning of line inside parentheses" "
629
629
data T = T {
630
630
foo :: String
631
631
, bar :: String
632
632
}
633
633
634
634
"
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 ))
636
638
; ;; haskell-indentation-tests.el ends here
You can’t perform that action at this time.
0 commit comments