From 52ab4ac76d8a40323b6479f12461cd2b55bdec19 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 13 May 2020 12:03:05 -0700 Subject: safer reindenting of 'where' on previous line Signed-off-by: Sean Whitton --- haskell-tab-indent.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'haskell-tab-indent.el') diff --git a/haskell-tab-indent.el b/haskell-tab-indent.el index 8ba205e..9515d2b 100644 --- a/haskell-tab-indent.el +++ b/haskell-tab-indent.el @@ -94,7 +94,11 @@ ;; more (prev-line-where ;; also ensure indentation of the 'where' is correct - (save-excursion (forward-line -1) (haskell-tab-indent)) + (save-excursion + (beginning-of-line 0) + (skip-chars-forward "\t") + (unless (looking-at " where$") + (insert " "))) (tabs (1+ prev-line-tabs))) ;; if the user explicitly requested an indent ;; change, cycle through the plausible indents -- cgit v1.2.3