@@ -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)
@@ -1032,7 +1034,8 @@ layout starts."
1032
1034
(haskell-indentation-read-next-token))
1033
1035
((eq current-token 'end-tokens )
1034
1036
(when (or (and
1035
- (not (string= following-token " {" ))
1037
+ (not (member following-token '(" {" operator)))
1038
+ (not (member previous-token '(operator)))
1036
1039
(haskell-indentation-expression-token-p following-token))
1037
1040
(string= following-token " ;" )
1038
1041
(and (equal layout-indent 0 )
@@ -1182,6 +1185,7 @@ line."
1182
1185
(> layout-indent (current-column )))
1183
1186
(setq current-token 'layout-end ))
1184
1187
(t
1188
+ (setq previous-token (haskell-indentation-peek-token))
1185
1189
(haskell-indentation-skip-token)
1186
1190
(if (>= (point ) indentation-point)
1187
1191
(progn
0 commit comments