Fix yasnippet breaking org-superstar

Because yasnippet has a delete first and ask never policy for cleaning
up overlays in the buffer.
This commit is contained in:
Henrik Lissner 2020-04-17 00:50:11 -04:00
parent 3e636f4dc7
commit 7662de55d8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -386,21 +386,25 @@ Made for `org-tab-first-hook' in evil-mode."
"Tries to expand a yasnippet snippet, if one is available. Made for "Tries to expand a yasnippet snippet, if one is available. Made for
`org-tab-first-hook'." `org-tab-first-hook'."
(when (bound-and-true-p yas-minor-mode) (when (bound-and-true-p yas-minor-mode)
(let ((major-mode (if (org-in-src-block-p t) (and (let ((major-mode (if (org-in-src-block-p t)
(org-src-get-lang-mode (org-eldoc-get-src-lang)) (org-src-get-lang-mode (org-eldoc-get-src-lang))
major-mode)) major-mode))
(org-src-tab-acts-natively nil) ; causes breakages (org-src-tab-acts-natively nil) ; causes breakages
;; Smart indentation doesn't work with yasnippet, and painfully slow ;; Smart indentation doesn't work with yasnippet, and painfully slow
;; in the few cases where it does. ;; in the few cases where it does.
(yas-indent-line 'fixed)) (yas-indent-line 'fixed))
(cond ((and (or (not (bound-and-true-p evil-local-mode)) (cond ((and (or (not (bound-and-true-p evil-local-mode))
(evil-insert-state-p)) (evil-insert-state-p))
(yas--templates-for-key-at-point)) (yas--templates-for-key-at-point))
(yas-expand) (yas-expand)
t) t)
((use-region-p) ((use-region-p)
(yas-insert-snippet) (yas-insert-snippet)
t))))) t)))
;; HACK Yasnippet breaks org-superstar-mode because yasnippets is
;; overzealous about cleaning up overlays.
(when (bound-and-true-p org-superstar-mode)
(org-superstar-restart)))))
;;;###autoload ;;;###autoload
(defun +org-cycle-only-current-subtree-h (&optional arg) (defun +org-cycle-only-current-subtree-h (&optional arg)