[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 17fe790 51/60: Fix #515; only clear field on self-insert
From: |
João Távora |
Subject: |
[elpa] master 17fe790 51/60: Fix #515; only clear field on self-insert |
Date: |
Thu, 21 Jan 2016 22:36:06 +0000 |
branch: master
commit 17fe7904ae422a5ae4ddfd561fc506c2791bdb18
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Fix #515; only clear field on self-insert
* yasnippet.el (yas--on-field-overlay-modification): Only clear field if
`this-command' is `self-insert-command'. Clean up docstring.
Close #639.
---
yasnippet.el | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index f468aab..592742f 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3385,9 +3385,8 @@ Move the overlay, or create it if it does not exit."
(defun yas--on-field-overlay-modification (overlay after? _beg _end &optional
_length)
"Clears the field and updates mirrors, conditionally.
-Only clears the field if it hasn't been modified and it point it
-at field start. This hook doesn't do anything if an undo is in
-progress."
+Only clears the field if it hasn't been modified and point is at
+field start. This hook does nothing if an undo is in progress."
(unless (or yas--inhibit-overlay-hooks
(not (overlayp yas--active-field-overlay)) ; Avoid Emacs bug
#21824.
(yas--undo-in-progress))
@@ -3399,7 +3398,8 @@ progress."
(yas--field-update-display field))
(yas--update-mirrors snippet))
(field
- (when (and (not (yas--field-modified-p field))
+ (when (and (eq this-command 'self-insert-command)
+ (not (yas--field-modified-p field))
(= (point) (yas--field-start field)))
(yas--skip-and-clear field))
(setf (yas--field-modified-p field) t))))))
- [elpa] master b055f13 34/60: Fix #617; ensure point is visible before x prompt, (continued)
- [elpa] master b055f13 34/60: Fix #617; ensure point is visible before x prompt, João Távora, 2016/01/21
- [elpa] master f121645 38/60: Fix #607; avoid Emacs bug #21824, João Távora, 2016/01/21
- [elpa] master 1cf723a 41/60: Ignore trailing spaces in snippet definitions, João Távora, 2016/01/21
- [elpa] master 2100b89 42/60: Closes #632: Use `user-emacs-directory' instead of hardcoded "~/emacs.d", João Távora, 2016/01/21
- [elpa] master beb02e5 39/60: * CONTRIBUTING.md: Add note about changelog only messages., João Távora, 2016/01/21
- [elpa] master fb28ec8 37/60: * README.mdown (Use `yas-minor-mode`): Reword., João Távora, 2016/01/21
- [elpa] master 6c46878 43/60: Fix #587; set `this-command' on fallback., João Távora, 2016/01/21
- [elpa] master 23ee54e 44/60: Use destructive list functions in yas--s-a-p, João Távora, 2016/01/21
- [elpa] master 3aa7cb2 40/60: M-x delete-trailing-whitespace, João Távora, 2016/01/21
- [elpa] master d78181a 46/60: Remove yas--inhibit-overlay-hooks macro., João Távora, 2016/01/21
- [elpa] master 17fe790 51/60: Fix #515; only clear field on self-insert,
João Távora <=
- [elpa] master 67a45a6 48/60: * README.mdown: Add link to textmate-to-yas.el., João Távora, 2016/01/21
- [elpa] master c80fbf2 49/60: Cleanup yas--on-field-overlay-modification, João Távora, 2016/01/21
- [elpa] master 444c882 47/60: * README.mdown: update melpa URL., João Távora, 2016/01/21
- [elpa] master 61261c9 53/60: Fix #576; don't override yas-prompt-functions, João Távora, 2016/01/21
- [elpa] master a2c5292 55/60: Bless Noam Postavsky as the new official maintainer, João Távora, 2016/01/21
- [elpa] master cd05da6 36/60: Activate extra and major modes first, João Távora, 2016/01/21
- [elpa] master 3cd64b7 45/60: yasnippet.el (yas--called-interactively-p): Remove., João Távora, 2016/01/21
- [elpa] master 140c415 52/60: Respect y-b-l-cond from binding triggered snippets, João Távora, 2016/01/21
- [elpa] master 71f0142 50/60: Improve test simulatulation of self-insert, João Távora, 2016/01/21
- [elpa] master e6fff09 54/60: Don't choose ido prompting based on Emacs version, João Távora, 2016/01/21