summaryrefslogtreecommitdiff
path: root/cider-mode.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-11-28 00:45:08 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-11-28 00:48:28 +0000
commit2155a6b698ba7fbf4b98c8dbaa2975a60bf392ef (patch)
tree8ed63e49f0ee48d4c95a195ca831507f0fa69c05 /cider-mode.el
parent77916c0fde564ba664a95822e5a4ee0b6e6cf8bf (diff)
[Fix #1421] Prevent font-lock from modifying the buffer
Diffstat (limited to 'cider-mode.el')
-rw-r--r--cider-mode.el25
1 files changed, 13 insertions, 12 deletions
diff --git a/cider-mode.el b/cider-mode.el
index f0cd163d..3b7afaf9 100644
--- a/cider-mode.el
+++ b/cider-mode.el
@@ -544,18 +544,19 @@ before point."
The local variables are stored in a list under the `cider-locals' text
property."
(lambda (beg end &rest rest)
- (remove-text-properties beg end '(cider-locals nil cider-block-dynamic-font-lock nil))
- (when cider-font-lock-dynamically
- (save-excursion
- (goto-char beg)
- ;; If the inside of a `ns' form changed, reparse it from the start.
- (when (and (not (bobp))
- (get-text-property (1- (point)) 'cider-block-dynamic-font-lock))
- (ignore-errors (beginning-of-defun)))
- (ignore-errors
- (cider--parse-and-apply-locals
- end (unless (bobp)
- (get-text-property (1- (point)) 'cider-locals))))))
+ (with-silent-modifications
+ (remove-text-properties beg end '(cider-locals nil cider-block-dynamic-font-lock nil))
+ (when cider-font-lock-dynamically
+ (save-excursion
+ (goto-char beg)
+ ;; If the inside of a `ns' form changed, reparse it from the start.
+ (when (and (not (bobp))
+ (get-text-property (1- (point)) 'cider-block-dynamic-font-lock))
+ (ignore-errors (beginning-of-defun)))
+ (ignore-errors
+ (cider--parse-and-apply-locals
+ end (unless (bobp)
+ (get-text-property (1- (point)) 'cider-locals)))))))
(apply func beg end rest)))