@@ -388,6 +388,7 @@ and indent when all of the following are true:
388
388
; ; the token at the current parser point or a pseudo-token (see
389
389
; ; `haskell-indentation-read-next-token' )
390
390
(defvar current-token )
391
+ (defvar previous-token )
391
392
(defvar left-indent ) ; ; most left possible indentation
392
393
(defvar starter-indent ) ; ; column at a keyword
393
394
(defvar current-indent ) ; ; the most right indentation
@@ -456,6 +457,7 @@ and indent when all of the following are true:
456
457
(left-indent haskell-indentation-layout-offset)
457
458
(case-fold-search nil )
458
459
current-token
460
+ previous-token
459
461
following-token
460
462
possible-indentations
461
463
implicit-layout-active)
@@ -1030,7 +1032,8 @@ layout starts."
1030
1032
(haskell-indentation-read-next-token))
1031
1033
((eq current-token 'end-tokens )
1032
1034
(when (or (and
1033
- (not (string= following-token " {" ))
1035
+ (not (member following-token '(" {" operator)))
1036
+ (not (member previous-token '(operator)))
1034
1037
(haskell-indentation-expression-token-p following-token))
1035
1038
(string= following-token " ;" )
1036
1039
(and (equal layout-indent 0 )
@@ -1180,6 +1183,7 @@ line."
1180
1183
(> layout-indent (current-column )))
1181
1184
(setq current-token 'layout-end ))
1182
1185
(t
1186
+ (setq previous-token (haskell-indentation-peek-token))
1183
1187
(haskell-indentation-skip-token)
1184
1188
(if (>= (point ) indentation-point)
1185
1189
(progn
0 commit comments