aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-05-12 21:39:25 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-05-12 21:39:56 -0700
commit9cecda40b00909163c67403fd764e991fdf64b2e (patch)
treed227a6005ca53f8c64df7ac8cae20f69763474dd
parent6ebc41ddb8c53d0752e2627fe56994ed9ae81b7c (diff)
downloadhaskell-tab-indent-9cecda40b00909163c67403fd764e991fdf64b2e.tar.gz
better regexp for first line of where clauses
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--NEWS.md7
-rw-r--r--haskell-tab-indent.el10
2 files changed, 12 insertions, 5 deletions
diff --git a/NEWS.md b/NEWS.md
index 7f0ad05..d1319c6 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,10 @@
+0.3 (unreleased)
+----------------
+
+- When checking whether we're on the first line of where clause,
+ require 'where' followed by end of line, rather than just a line
+ starting with 'where'.
+
0.2 (2019-04-15)
----------------
diff --git a/haskell-tab-indent.el b/haskell-tab-indent.el
index 636713b..e9ac7a3 100644
--- a/haskell-tab-indent.el
+++ b/haskell-tab-indent.el
@@ -1,11 +1,11 @@
;;; haskell-tab-indent.el --- tab-based indentation for haskell-mode
-;; Copyright (C) 2015, 2017 Sean Whitton
+;; Copyright (C) 2015, 2017, 2020 Sean Whitton
;; Author: Sean Whitton <spwhitton@spwhitton.name>
;; URL: https://spwhitton.name/tech/code/haskell-tab-indent/
-;; Version: 0.2
-;; Package-Version: 0.2
+;; Version: 0.3
+;; Package-Version: 0.3
;; Keywords: indentation, haskell
;; This file is NOT part of GNU Emacs.
@@ -56,8 +56,8 @@
(save-excursion
(back-to-indentation)
;; check for special case of where clause
- (if (looking-at "where")
- (haskell-tab-indent--where)
+ (if (looking-at "where$")
+ (haskell-tab-indent--where)
;; check for special case of being called by
;; `newline-and-indent': if the user has `electric-indent-mode'
;; on and RET bound to `newline-and-indent', we'll end up