[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fc33b2f 28/42: Make overlay-modification protection option
From: |
Noam Postavsky |
Subject: |
[elpa] master fc33b2f 28/42: Make overlay-modification protection optional |
Date: |
Sun, 22 Dec 2019 17:38:01 -0500 (EST) |
branch: master
commit fc33b2fbaee6c514c91e80f5b1c0210c776b03ed
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Make overlay-modification protection optional
* yasnippet.el (yas-inhibit-overlay-modification-protection): New
variable.
(yas--on-protection-overlay-modification): Consult it.
---
yasnippet.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/yasnippet.el b/yasnippet.el
index ac1c23f..dcf593e 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -567,6 +567,16 @@ This is useful to control whether snippet navigation
bindings
override `keymap' overlay property bindings from other packages."
:type 'integer)
+(defcustom yas-inhibit-overlay-modification-protection nil
+ "If nil, changing text outside the active field aborts the snippet.
+This protection is intended to prevent yasnippet from ending up
+in an inconsistent state. However, some packages (e.g., the
+company completion package) may trigger this protection when it
+is not needed. In that case, setting this variable to non-nil
+can be useful."
+ ;; See also `yas--on-protection-overlay-modification'.
+ :type 'boolean)
+
;;; Internal variables
@@ -3931,6 +3941,7 @@ Move the overlays, or create them if they do not exit."
(defun yas--on-protection-overlay-modification (_overlay after? beg end
&optional length)
"Commit the snippet if the protection overlay is being killed."
(unless (or yas--inhibit-overlay-hooks
+ yas-inhibit-overlay-modification-protection
(not after?)
(= length (- end beg)) ; deletion or insertion
(yas--undo-in-progress))
- [elpa] master 7a178a2 07/42: Remove spurious change of before-change-functions, (continued)
- [elpa] master 7a178a2 07/42: Remove spurious change of before-change-functions, Noam Postavsky, 2019/12/22
- [elpa] master 8328c38 08/42: Fix another failure of cc-mode indentation, Noam Postavsky, 2019/12/22
- [elpa] master eeb05f0 10/42: Handle field adjust of pending active fields, Noam Postavsky, 2019/12/22
- [elpa] master 8452227 13/42: Consider fundamental-mode as ultimate ancestor, Noam Postavsky, 2019/12/22
- [elpa] master fb253ac 15/42: New public function yas-maybe-expand-abbrev-key-filter, Noam Postavsky, 2019/12/22
- [elpa] master bceb65b 16/42: Make backspace/DEL clear field (#957), Noam Postavsky, 2019/12/22
- [elpa] master 3c0be40 11/42: Update FAQ, Noam Postavsky, 2019/12/22
- [elpa] master 8b25d62 20/42: * doc/snippet-development.org: Fix typos., Noam Postavsky, 2019/12/22
- [elpa] master 7612bc1 24/42: Don't check this-command in yas-not-string-or-comment-condition, Noam Postavsky, 2019/12/22
- [elpa] master dabc719 21/42: Don't turn on yas-minor-mode in temp buffers, Noam Postavsky, 2019/12/22
- [elpa] master fc33b2f 28/42: Make overlay-modification protection optional,
Noam Postavsky <=
- [elpa] master 048d030 22/42: Fix line-relative snapshotting for org src blocks, Noam Postavsky, 2019/12/22
- [elpa] master bae20af 27/42: ; * doc/faq.org: Linkify bug reference., Noam Postavsky, 2019/12/22
- [elpa] master ffc733d 09/42: ; Debug code fixes, Noam Postavsky, 2019/12/22
- [elpa] master 1d96da2 18/42: Don't call before/after change-functions twice, Noam Postavsky, 2019/12/22
- [elpa] master 6a3619b 23/42: Fix additional corner case with org source block integration, Noam Postavsky, 2019/12/22
- [elpa] master 9cedd59 25/42: Allow disabling snippet keybindings from hook, Noam Postavsky, 2019/12/22
- [elpa] master 55c448b 32/42: Remove redundant arg to yas-expand-snippet, Noam Postavsky, 2019/12/22
- [elpa] master 189f737 26/42: * doc/faq.org: Note that Flyspell problem is (now fixed) Emacs bug., Noam Postavsky, 2019/12/22
- [elpa] master ffce236 30/42: Do auto indentation only in post command hook, Noam Postavsky, 2019/12/22
- [elpa] master 760f77a 12/42: Test for mirroring more than one field, Noam Postavsky, 2019/12/22