mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
a minor change, having trouble debugging on mac
This commit is contained in:
parent
6354579eed
commit
5f5e23c829
@ -1,5 +1,8 @@
|
||||
#name : <dov...>...</dov>
|
||||
# --
|
||||
a mirror up here $3
|
||||
|
||||
|
||||
<dov ${1:id="${2:some_id and here comes another nested field: ${3:nested_shit}}"}>
|
||||
$0
|
||||
</dov>
|
||||
|
@ -1,8 +1,9 @@
|
||||
#name : foo { ... } ; setFoo { ... }
|
||||
# --
|
||||
- (${1:id})${2:foo}
|
||||
- ${1:id} ${2:foo and its ${3:nested} shit}
|
||||
{
|
||||
return $2;
|
||||
// dont forget we have $3
|
||||
}
|
||||
|
||||
- (void)set${2:$(capitalize text)}:($1)aValue
|
||||
|
13
yasnippet.el
13
yasnippet.el
@ -1059,20 +1059,20 @@ snippet, if so cleans up the whole snippet up."
|
||||
(dolist (snippet snippets)
|
||||
;; TODO: handle nested field exceptions, smaller, more nested
|
||||
;; find should come up earlier as `containing-field's
|
||||
(let ((containing-field (find-if #'yas/field-contains-point-p (reverse (yas/snippet-fields snippet)))))
|
||||
(cond ((not containing-field)
|
||||
(let ((active-field (yas/snippet-active-field snippet)))
|
||||
(cond ((not (and active-field (yas/field-contains-point-p active-field)))
|
||||
(yas/commit-snippet snippet))
|
||||
((and containing-field
|
||||
((and active-field
|
||||
(or (not yas/active-field-overlay)
|
||||
(not (overlay-buffer yas/active-field-overlay))))
|
||||
(save-excursion
|
||||
(yas/move-to-field snippet containing-field)))
|
||||
(yas/move-to-field snippet active-field)))
|
||||
(t
|
||||
nil))))))
|
||||
|
||||
(defun yas/field-contains-point-p (field)
|
||||
(and (>= (point) (yas/field-start field))
|
||||
(< (point) (yas/field-end field))))
|
||||
(<= (point) (yas/field-end field))))
|
||||
|
||||
(defun yas/pre-command-handler ()
|
||||
)
|
||||
@ -1327,8 +1327,8 @@ Allows nested placeholder in the style of Textmate."
|
||||
(set-marker (yas/mirror-end mirror) (point)))
|
||||
|
||||
|
||||
|
||||
;; Debug functions. Use (or change) at will whenever needed.
|
||||
;;
|
||||
|
||||
(defun yas/debug-some-vars ()
|
||||
(interactive)
|
||||
@ -1362,7 +1362,6 @@ Allows nested placeholder in the style of Textmate."
|
||||
(yas/load-directory "~/Source/yasnippet/snippets/")
|
||||
;;(kill-buffer (get-buffer "*YAS TEST*"))
|
||||
(set-buffer (switch-to-buffer "*YAS TEST*"))
|
||||
(yas/exterminate-snippets)
|
||||
(erase-buffer)
|
||||
(setq buffer-undo-list nil)
|
||||
(html-mode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user