Making post-command-hook local-variable is riskey.
This commit is contained in:
parent
cdd8eb71a3
commit
f71358c4d0
@ -54,7 +54,7 @@
|
|||||||
(ghc-type-clear-overlay)
|
(ghc-type-clear-overlay)
|
||||||
(setq after-change-functions
|
(setq after-change-functions
|
||||||
(cons 'ghc-type-clear-overlay after-change-functions))
|
(cons 'ghc-type-clear-overlay after-change-functions))
|
||||||
(set (make-local-variable 'post-command-hook) 'ghc-type-post-command-hook))
|
(add-hook 'post-command-hook 'ghc-type-post-command-hook))
|
||||||
|
|
||||||
(defun ghc-type-clear-overlay (&optional beg end len)
|
(defun ghc-type-clear-overlay (&optional beg end len)
|
||||||
(when (overlayp ghc-type-overlay)
|
(when (overlayp ghc-type-overlay)
|
||||||
@ -63,7 +63,8 @@
|
|||||||
(move-overlay ghc-type-overlay 0 0)))
|
(move-overlay ghc-type-overlay 0 0)))
|
||||||
|
|
||||||
(defun ghc-type-post-command-hook ()
|
(defun ghc-type-post-command-hook ()
|
||||||
(when (and (overlayp ghc-type-overlay)
|
(when (and (eq major-mode 'haskell-mode)
|
||||||
|
(overlayp ghc-type-overlay)
|
||||||
(/= (ghc-type-get-point) (point)))
|
(/= (ghc-type-get-point) (point)))
|
||||||
(ghc-type-clear-overlay)))
|
(ghc-type-clear-overlay)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user