summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2016-04-04 14:21:06 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2016-04-04 14:21:17 -0300
commit3e9612418f87236fb5a1aec0525610ea88508bc6 (patch)
tree3a39d377ea7a87120d83f8f8c28fe5962592348a
parent67fa7e1a60966e49eccf21b02110af12afa995e0 (diff)
[#77] Actually use aggressive-indent--balanced-parens
-rw-r--r--aggressive-indent.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/aggressive-indent.el b/aggressive-indent.el
index 31cee72..36a7f42 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -349,9 +349,12 @@ or messages."
"List of (left right) limit of regions changed in the last command loop.")
(make-variable-buffer-local 'aggressive-indent--changed-list)
+(defvar-local aggressive-indent--balanced-parens t
+ "Non-nil if the current-buffer has balanced parens.")
+
(defun aggressive-indent--indent-if-changed ()
"Indent any region that changed in the last command loop."
- (when aggressive-indent--changed-list
+ (when (and aggressive-indent--changed-list aggressive-indent--balanced-parens)
(save-excursion
(save-selected-window
(unless (or (run-hook-wrapped 'aggressive-indent--internal-dont-indent-if #'eval)
@@ -368,9 +371,6 @@ or messages."
(setq aggressive-indent--changed-list
(cdr aggressive-indent--changed-list))))))))))
-(defvar-local aggressive-indent--balanced-parens t
- "Non-nil if the current-buffer has balanced parens.")
-
(defun aggressive-indent--check-parens ()
"Check if parens are balanced in the current buffer.
Store result in `aggressive-indent--balanced-parens'."