]> code.delx.au - gnu-emacs-elpa/commit
Only kill snippets for text length change
authorNoam Postavsky <github.10.npostavs@spamgourmet.com>
Sat, 16 Apr 2016 15:31:44 +0000 (11:31 -0400)
committerNoam Postavsky <github.10.npostavs@spamgourmet.com>
Sat, 16 Apr 2016 15:31:44 +0000 (11:31 -0400)
commit4f2aa1526a3a630a984bc00c45204ee35a7ba556
treee1ef8e411e55053a509bc7988ae6ec016d2a1918
parentbd30a30d88bd78c5a47b479c3bcaf3c540810541
Only kill snippets for text length change

of protection overlay.  Changes that keep the same length of text are
probably harmless (e.g. just change of text properties).  It's possible
that some harmful changes don't change text length, but the protection
overlays are already unable to catch all important changes since they
only cover 1 character each at the edges.

cc-mode modifies text properties in the buffer to cache parsing results,
therefore it's important that yasnippet not kill yasnippets when parsing
is triggered by a function that only wants to parse the
buffer (e.g. which-function-mode).

* yasnippet.el (yas--on-protection-overlay-modification): Check length
of text change to decide if change is harmful.  Fix docstring.
yasnippet.el