mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-16 02:14:17 +00:00
* Fixed the "direct-keymaps" bug with `emulation-mode-map-alists'
* Fixed a bug when evaluating primary field expressions * Completed importation of TextMate HTML snippets, some TextMate HTML commands missing.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
(setq word-begin (point))
|
||||
(forward-word 1)
|
||||
(setq word-end (point)))
|
||||
(when (and (> word-end word-begin)
|
||||
(when (and (< word-begin orig-point)
|
||||
(>= word-end (point)))
|
||||
(setq retval
|
||||
(cons
|
||||
@@ -57,12 +57,19 @@
|
||||
|
||||
(defun yas/html-wrap-each-line-in-openclose-tag ()
|
||||
(let* ((mirror "${1:$(yas/html-first-word yas/text)}")
|
||||
(yas/html-wrap-newline (when (string-match "\n" yas/selected-text) "\n"))
|
||||
(template (concat (format "<${1:%s}>" (or yas/html-default-tag "p"))
|
||||
yas/selected-text
|
||||
"</" mirror ">")))
|
||||
(setq template (replace-regexp-in-string "\n" (concat "</" mirror ">\n<" mirror ">") template))
|
||||
(setq template (replace-regexp-in-string "\n" (concat "</" mirror ">\n<$1>") template))
|
||||
(yas/expand-snippet template)))
|
||||
|
||||
(defun yas/html-wrap-selection-if-not-wrapped-already (wrapping)
|
||||
(if (string-match (format "<%s>.*</%s>" wrapping wrapping) yas/selected-text)
|
||||
(insert yas/selected-text)
|
||||
(insert (format "<%s>%s</%s>" wrapping yas/selected-text wrapping))))
|
||||
|
||||
|
||||
(defun yas/html-between-tag-pair-p ()
|
||||
(save-excursion
|
||||
(backward-word)
|
||||
|
||||
Reference in New Issue
Block a user