branch: master
commit 1c97671c6e47463f9ef3d4cf6d5fefc721d9c726
Author: João Távora <[email protected]>
Commit: João Távora <[email protected]>
Closes #536: Fix navigation to zero-length fields at snippet end
* yasnippet.el (yas--field-probably-deleted-p): A deleted field
was probably modified before, so enforce that condition.
---
yasnippet.el | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 1644a85..cb1d041 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -3032,12 +3032,14 @@ through the field's start point"
;; field must be zero length
;;
(zerop (- (yas--field-start field) (yas--field-end field)))
- ;; skip if:
+ ;; field must have been modified
+ ;;
+ (yas--field-modified-p field)
+ ;; either:
(or
- ;; 1) is a nested field and it's been modified
+ ;; 1) it's a nested field
;;
- (and (yas--field-parent-field field)
- (yas--field-modified-p field))
+ (yas--field-parent-field field)
;; 2) ends just before the snippet end
;;
(and (eq field (car (last (yas--snippet-fields snippet))))