emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c35bc62 039/108: Skip indenting lines only barely touched


From: Artur Malabarba
Subject: [elpa] master c35bc62 039/108: Skip indenting lines only barely touched by changed region.
Date: Wed, 25 Mar 2015 18:38:59 +0000

branch: master
commit c35bc623ba92262784f980d93e44c814b8af280b
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]