branch: master
commit c35bc623ba92262784f980d93e44c814b8af280b
Author: Artur Malabarba <[email protected]>
Commit: Artur Malabarba <[email protected]>
Skip indenting lines only barely touched by changed region.
---
aggressive-indent.el | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/aggressive-indent.el b/aggressive-indent.el
index e2ed5d8..ad046d2 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -263,6 +263,11 @@ until nothing more happens."
(goto-char r)
(setq was-begining-of-line
(= r (line-beginning-position)))
+ ;; If L is at the end of a line, skip that line.
+ (unless (= l r)
+ (goto-char l)
+ (when (= l (line-end-position))
+ (cl-incf l)))
;; Indent the affected region.
(unless (= l r) (indent-region l r))
;; `indent-region' doesn't do anything if R was the beginning of a line,
so we indent manually there.