]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/aggressive-indent/aggressive-indent.el
Merge commit '6238e7402adabd0003f6ffcf5c57d9f18f1e7684'
[gnu-emacs-elpa] / packages / aggressive-indent / aggressive-indent.el
index d6d201dbaa5850abd2014fc0d3da6fec2cd9ad9b..f9a0df313d453c36a7bdc3deeaf4a6d36b4be7b0 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Artur Malabarba <emacs@endlessparentheses.com>
 ;; URL: http://github.com/Malabarba/aggressive-indent-mode
-;; Version: 1.1.2
+;; Version: 1.1.3
 ;; Package-Requires: ((emacs "24.1") (names "20150125.9") (cl-lib "0.5"))
 ;; Keywords: indent lisp maint tools
 ;; Prefix: aggressive-indent
@@ -325,10 +325,15 @@ until nothing more happens."
                  (point-limit (if (and eod (< (point) eod))
                                   eod (point-max-marker))))
             (while (and (null (eobp))
-                        (< (point) point-limit)
-                        (/= (point)
-                            (progn (indent-according-to-mode)
-                                   (point))))
+                        (let ((op (point))
+                              (np (progn (indent-according-to-mode)
+                                         (point))))
+                          ;; As long as we're indenting things to the
+                          ;; left, keep indenting.
+                          (or (< np op)
+                              ;; If we're indenting to the right, or
+                              ;; not at all, stop at the limit.
+                              (< (point) point-limit))))
               (forward-line 1)
               (skip-chars-forward "[:blank:]\n"))))
       (goto-char p))))