]> code.delx.au - gnu-emacs-elpa/commit
Slightly improve on fix for #515: Refactor code and add tests
authorJoão Távora <joaotavora@gmail.com>
Mon, 4 Jan 2016 10:15:31 +0000 (10:15 +0000)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Fri, 22 Jan 2016 16:19:34 +0000 (11:19 -0500)
commit4a6d923c9db7e0b3f1ef6753cf438da1ffe89777
tree4c18d71105b8e8346da3f55e062d0496c447d8cd
parent1a98c38d9cac584a56cefd74612eefb335e89325
Slightly improve on fix for #515: Refactor code and add tests

While I agree with the solution for #515 in commit 17fe790 for now,
other approaches might be interesting in the future, like clearing on
other types of insertion, not just self-insertion.

So add some tests and refactor a new function that could be used for
that purpose later on. For now, change no behaviour.

* yasnippet-tests.el (dont-clear-on-partial-deletion-issue-515,
  dont-clear-on-yank-issue-515): New tests. (yas-mock-yank): New
  function.

* yasnippet.el (yas--skip-and-clear-field-p): New function.
  (yas--on-field-overlay-modification): Use it.
yasnippet-tests.el
yasnippet.el