From 9cecda40b00909163c67403fd764e991fdf64b2e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 12 May 2020 21:39:25 -0700 Subject: better regexp for first line of where clauses Signed-off-by: Sean Whitton --- NEWS.md | 7 +++++++ haskell-tab-indent.el | 10 +++++----- 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 ;; 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 -- cgit v1.2.3