Skip to content

Commit b1bc0f6

Browse files
committed
[#464] only run pre-command-hook if smartparens-mode is active
1 parent 4d15710 commit b1bc0f6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

smartparens.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,9 +3260,10 @@ last form; otherwise do nothing."
32603260
;; why we need each of these.
32613261
(defun sp--save-pre-command-state ()
32623262
"Save some of the buffer state before `pre-command-hook'."
3263-
(setq sp-point-inside-string (sp-point-in-string))
3264-
(setq sp-pre-command-point (point))
3265-
(setq sp-buffer-modified-p (buffer-modified-p)))
3263+
(when smartparens-mode
3264+
(setq sp-point-inside-string (sp-point-in-string))
3265+
(setq sp-pre-command-point (point))
3266+
(setq sp-buffer-modified-p (buffer-modified-p))))
32663267

32673268
(add-hook 'pre-command-hook 'sp--save-pre-command-state)
32683269

0 commit comments

Comments
 (0)