a minor change, having trouble debugging on mac

This commit is contained in:
capitaomorte 2009-07-06 21:38:41 +00:00
parent 6354579eed
commit 5f5e23c829
3 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,8 @@
#name : <dov...>...</dov> #name : <dov...>...</dov>
# -- # --
a mirror up here $3
<dov ${1:id="${2:some_id and here comes another nested field: ${3:nested_shit}}"}> <dov ${1:id="${2:some_id and here comes another nested field: ${3:nested_shit}}"}>
$0 $0
</dov> </dov>

View File

@ -1,8 +1,9 @@
#name : foo { ... } ; setFoo { ... } #name : foo { ... } ; setFoo { ... }
# -- # --
- (${1:id})${2:foo} - ${1:id} ${2:foo and its ${3:nested} shit}
{ {
return $2; return $2;
// dont forget we have $3
} }
- (void)set${2:$(capitalize text)}:($1)aValue - (void)set${2:$(capitalize text)}:($1)aValue

View File

@ -1059,20 +1059,20 @@ snippet, if so cleans up the whole snippet up."
(dolist (snippet snippets) (dolist (snippet snippets)
;; TODO: handle nested field exceptions, smaller, more nested ;; TODO: handle nested field exceptions, smaller, more nested
;; find should come up earlier as `containing-field's ;; find should come up earlier as `containing-field's
(let ((containing-field (find-if #'yas/field-contains-point-p (reverse (yas/snippet-fields snippet))))) (let ((active-field (yas/snippet-active-field snippet)))
(cond ((not containing-field) (cond ((not (and active-field (yas/field-contains-point-p active-field)))
(yas/commit-snippet snippet)) (yas/commit-snippet snippet))
((and containing-field ((and active-field
(or (not yas/active-field-overlay) (or (not yas/active-field-overlay)
(not (overlay-buffer yas/active-field-overlay)))) (not (overlay-buffer yas/active-field-overlay))))
(save-excursion (save-excursion
(yas/move-to-field snippet containing-field))) (yas/move-to-field snippet active-field)))
(t (t
nil)))))) nil))))))
(defun yas/field-contains-point-p (field) (defun yas/field-contains-point-p (field)
(and (>= (point) (yas/field-start field)) (and (>= (point) (yas/field-start field))
(< (point) (yas/field-end field)))) (<= (point) (yas/field-end field))))
(defun yas/pre-command-handler () (defun yas/pre-command-handler ()
) )
@ -1327,8 +1327,8 @@ Allows nested placeholder in the style of Textmate."
(set-marker (yas/mirror-end mirror) (point))) (set-marker (yas/mirror-end mirror) (point)))
;; Debug functions. Use (or change) at will whenever needed. ;; Debug functions. Use (or change) at will whenever needed.
;;
(defun yas/debug-some-vars () (defun yas/debug-some-vars ()
(interactive) (interactive)
@ -1362,7 +1362,6 @@ Allows nested placeholder in the style of Textmate."
(yas/load-directory "~/Source/yasnippet/snippets/") (yas/load-directory "~/Source/yasnippet/snippets/")
;;(kill-buffer (get-buffer "*YAS TEST*")) ;;(kill-buffer (get-buffer "*YAS TEST*"))
(set-buffer (switch-to-buffer "*YAS TEST*")) (set-buffer (switch-to-buffer "*YAS TEST*"))
(yas/exterminate-snippets)
(erase-buffer) (erase-buffer)
(setq buffer-undo-list nil) (setq buffer-undo-list nil)
(html-mode) (html-mode)