mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 13:33:04 +00:00
bugfix: fix #245
This commit is contained in:
parent
cfd92598e8
commit
c9bd102cb3
25
yasnippet.el
25
yasnippet.el
@ -2860,13 +2860,24 @@ have, compare through the field's start point"
|
|||||||
|
|
||||||
(defun yas/field-probably-deleted-p (snippet field)
|
(defun yas/field-probably-deleted-p (snippet field)
|
||||||
"Guess if SNIPPET's FIELD should be skipped."
|
"Guess if SNIPPET's FIELD should be skipped."
|
||||||
(and (zerop (- (yas/field-start field) (yas/field-end field)))
|
(and
|
||||||
(or (yas/field-parent-field field)
|
;; field must be zero lentgh
|
||||||
(and (eq field (car (last (yas/snippet-fields snippet))))
|
;;
|
||||||
(= (yas/field-start field) (overlay-end (yas/snippet-control-overlay snippet)))))
|
(zerop (- (yas/field-start field) (yas/field-end field)))
|
||||||
;; the field numbered 0, just before the exit marker, should
|
;; skip if:
|
||||||
;; never be skipped
|
(or
|
||||||
(not (zerop (yas/field-number field)))))
|
;; 1) is a nested field and it's been modified
|
||||||
|
;;
|
||||||
|
(and (yas/field-parent-field field)
|
||||||
|
(yas/field-modified-p field))
|
||||||
|
;; 2) ends just before the snippet end
|
||||||
|
;;
|
||||||
|
(and (eq field (car (last (yas/snippet-fields snippet))))
|
||||||
|
(= (yas/field-start field) (overlay-end (yas/snippet-control-overlay snippet)))))
|
||||||
|
;; the field numbered 0, just before the exit marker, should
|
||||||
|
;; never be skipped
|
||||||
|
;;
|
||||||
|
(not (zerop (yas/field-number field)))))
|
||||||
|
|
||||||
(defun yas/snippets-at-point (&optional all-snippets)
|
(defun yas/snippets-at-point (&optional all-snippets)
|
||||||
"Return a sorted list of snippets at point, most recently
|
"Return a sorted list of snippets at point, most recently
|
||||||
|
Loading…
x
Reference in New Issue
Block a user