Skip to content

Commit

Permalink
Reset memoization in post command hook
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjensen committed Jul 12, 2016
1 parent be8e135 commit 56c5b74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions smartparens.el
Expand Up @@ -2428,6 +2428,7 @@ should be highlighted."
"Remove all pair overlays that doesn't have point inside them,
are of zero length, or if point moved backwards."
;; if the point moved backwards, remove all overlays
(sp--reset-memoization)
(if (and sp-cancel-autoskip-on-backward-movement
(< (point) sp-previous-point))
(dolist (o sp-pair-overlay-list) (sp--remove-overlay o))
Expand All @@ -2440,6 +2441,11 @@ are of zero length, or if point moved backwards."
(when sp-pair-overlay-list
(setq sp-previous-point (point))))

(defun sp--reset-memoization ()
"Reset memoization as a safety precaution."
(setf (sp-state-last-syntax-ppss-point sp-state) nil
(sp-state-last-syntax-ppss-result sp-state) nil))

(defun sp-remove-active-pair-overlay ()
"Deactivate the active overlay. See `sp--get-active-overlay'."
(interactive)
Expand Down

0 comments on commit 56c5b74

Please sign in to comment.