branch: master commit a2fad89e551490ab8250e57a754185efb657bee9 Author: Artur Malabarba <bruce.connor...@gmail.com> Commit: Artur Malabarba <bruce.connor...@gmail.com>
[Fix #53] Indent more aggressively --- aggressive-indent.el | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/aggressive-indent.el b/aggressive-indent.el index 636504d..82e5fbf 100644 --- a/aggressive-indent.el +++ b/aggressive-indent.el @@ -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))))