diff --git a/aggressive-indent.el b/aggressive-indent.el index ce64240..828d777 100644 --- a/aggressive-indent.el +++ b/aggressive-indent.el @@ -389,8 +389,9 @@ or messages." (defun aggressive-indent--proccess-changed-list-and-indent () "Indent the regions in `aggressive-indent--changed-list'." - (unless (or (run-hook-wrapped 'aggressive-indent--internal-dont-indent-if #'eval) - (aggressive-indent--run-user-hooks)) + (if (or (run-hook-wrapped 'aggressive-indent--internal-dont-indent-if #'eval) + (aggressive-indent--run-user-hooks)) + (setq aggressive-indent--changed-list nil) ;; forget any past changes (let ((inhibit-modification-hooks t) (inhibit-point-motion-hooks t) (indent-function @@ -426,8 +427,7 @@ typing, try tweaking this number." (defun aggressive-indent--keep-track-of-changes (l r &rest _) "Store the limits (L and R) of each change in the buffer." (when aggressive-indent-mode - (unless undo-in-progress - (push (list l r) aggressive-indent--changed-list)) + (push (list l r) aggressive-indent--changed-list) (unless (timerp aggressive-indent--idle-timer) (setq aggressive-indent--idle-timer (run-with-idle-timer aggressive-indent-sit-for-time t #'aggressive-indent--indent-if-changed)))))