diff options
author | Sebastien Chapuis <sebastien@chapu.is> | 2018-01-05 02:35:34 +0100 |
---|---|---|
committer | Sebastien Chapuis <sebastien@chapu.is> | 2018-01-05 02:41:00 +0100 |
commit | a30139eab6fb19173b9e1fe5ef3ae8b75de5a5a5 (patch) | |
tree | 4cbca560b6fb5dccfeb2a3f04d78e93876271895 | |
parent | 14ad9592a7101adb565f53c87ab9cd35504868bc (diff) |
[lsp-ui-peek] Use a timer to abort the mode #33
For more informations:
https://github.com/emacs-lsp/lsp-ui/issues/33#issuecomment-355449052
-rw-r--r-- | lsp-ui-peek.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lsp-ui-peek.el b/lsp-ui-peek.el index 0b3296a..557ae08 100644 --- a/lsp-ui-peek.el +++ b/lsp-ui-peek.el @@ -479,13 +479,18 @@ X OTHER-WINDOW." (define-key map [t]'lsp-ui-peek--abort) (setq lsp-ui-peek-mode-map map))) -(defun lsp-ui-peek--abort () - "." - (interactive) +(defun lsp-ui-peek--disable () + "Do not call this function, call `lsp-ui-peek--abort' instead." (when (bound-and-true-p lsp-ui-peek-mode) (lsp-ui-peek-mode -1) (lsp-ui-peek--peek-hide))) +(defun lsp-ui-peek--abort () + "." + (interactive) + ;; The timer fixes https://github.com/emacs-lsp/lsp-ui/issues/33 + (run-with-idle-timer 0 nil 'lsp-ui-peek--disable)) + (define-minor-mode lsp-ui-peek-mode "Mode for lsp-ui-peek." :init-value nil |