mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 05:03:04 +00:00
bug fix and add snippets for html-mode
This commit is contained in:
parent
43a6cd532c
commit
81b3a98f1e
3
snippets/html-mode/div
Normal file
3
snippets/html-mode/div
Normal file
@ -0,0 +1,3 @@
|
||||
#name : <div...>...</div>
|
||||
# --
|
||||
<div$1>$0</div>
|
3
snippets/html-mode/doctype
Normal file
3
snippets/html-mode/doctype
Normal file
@ -0,0 +1,3 @@
|
||||
#name : Doctype HTML 4.01 Strict
|
||||
# --
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
3
snippets/html-mode/doctype.xhml1
Normal file
3
snippets/html-mode/doctype.xhml1
Normal file
@ -0,0 +1,3 @@
|
||||
#name : DocType XHTML 1.0 frameset
|
||||
# --
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
3
snippets/html-mode/doctype.xhtml1_1
Normal file
3
snippets/html-mode/doctype.xhtml1_1
Normal file
@ -0,0 +1,3 @@
|
||||
#name : DocType XHTML 1.1
|
||||
# --
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
snippets/html-mode/doctype.xhtml1_strict
Normal file
3
snippets/html-mode/doctype.xhtml1_strict
Normal file
@ -0,0 +1,3 @@
|
||||
#name : DocType XHTML 1.0 Strict
|
||||
# --
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
snippets/html-mode/doctype.xhtml1_transitional
Normal file
3
snippets/html-mode/doctype.xhtml1_transitional
Normal file
@ -0,0 +1,3 @@
|
||||
#name : DocType XHTML 1.0 Transitional
|
||||
# --
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
@ -418,6 +418,8 @@ will be deleted before inserting template."
|
||||
(widen)
|
||||
(delete-char length)
|
||||
|
||||
(setq buffer-undo-list original-undo-list)
|
||||
|
||||
;; Step 14: place the cursor at a proper place
|
||||
(let ((groups (yas/snippet-groups snippet))
|
||||
(exit-marker (yas/snippet-exit-marker snippet)))
|
||||
@ -427,9 +429,7 @@ will be deleted before inserting template."
|
||||
(yas/group-primary-field
|
||||
(car groups)))))
|
||||
;; no need to call exit-snippet, since no overlay created.
|
||||
(goto-char exit-marker)))
|
||||
|
||||
(setq buffer-undo-list original-undo-list)))))
|
||||
(yas/exit-snippet snippet)))))))
|
||||
|
||||
(defun yas/current-snippet-overlay (&optional point)
|
||||
"Get the most proper overlay which is belongs to a snippet."
|
||||
@ -608,7 +608,7 @@ otherwise, nil returned."
|
||||
(let ((templates (gethash key (yas/current-snippet-table))))
|
||||
(if templates
|
||||
(let ((template (if (null (cdr templates)) ; only 1 template
|
||||
(cdar templates)
|
||||
(yas/template-content (cdar templates))
|
||||
(yas/popup-for-template templates))))
|
||||
(when template
|
||||
(yas/expand-snippet start end template)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user