From f10b199d9c5d68ad4dd644dbb4261edbebad6381 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 29 Apr 2019 23:43:19 -0400 Subject: [PATCH] Disable invisibility in snippet * yasnippet.el (yas--make-control-overlay): Set the `invisible' property in the snippet overlay. --- yasnippet.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yasnippet.el b/yasnippet.el index dcf593e8..d86630d3 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -3695,6 +3695,14 @@ holds the keymap." (overlay-put overlay 'keymap yas-keymap) (overlay-put overlay 'priority yas-overlay-priority) (overlay-put overlay 'yas--snippet snippet) + ;; We need `buffer-invisibility-spec' to be a list for sensible + ;; sematics (see also Emacs Bug#16493). + (unless (listp buffer-invisibility-spec) + (setq buffer-invisibility-spec '(t))) + ;; If the mode starts making parts of the snippet text invisible, + ;; point may get pushed around in unexpected ways, so disable + ;; invisibility within the snippet. + (overlay-put overlay 'invisible 'yas--no-invisible) overlay)) (defun yas-current-field ()