aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mode-def.el20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mode-def.el b/src/mode-def.el
index 24ea9ff..35a820e 100644
--- a/src/mode-def.el
+++ b/src/mode-def.el
@@ -171,7 +171,7 @@ See also `emmet-expand-line'."
(when markup
(delete-region (line-beginning-position) (overlay-end ovli))
(emmet-insert-and-flash markup)
- (when (= (elt markup 0) ?<)
+ (when (and emmet-move-cursor-after-expanding (= (elt markup 0) ?<))
(let ((p (point)))
(goto-char
(+ (- p (length markup))
@@ -187,7 +187,11 @@ See also `emmet-expand-line'."
(setq c (elt str i))
(case c
(?\" (if (not (= last-c ?\\))
- (setq instring (not instring))))
+ (progn (setq instring (not instring))
+ (when (and emmet-move-cursor-between-quotes
+ (not instring)
+ (= last-c ?\"))
+ (return i)))))
(?> (if (not instring)
(if intag
(if (= last-c ?/) (return (1+ i))
@@ -228,6 +232,18 @@ expansion after insertion."
:type '(number :tag "Seconds")
:group 'emmet)
+(defcustom emmet-move-cursor-after-expanding t
+ "If non-nil the the cursor position is
+moved to before the first closing tag when the exp was expanded."
+ :type 'boolean
+ :group 'emmet)
+
+(defcustom emmet-move-cursor-between-quotes nil
+ "If emmet-move-cursor-after-expands is non-nil and this is non-nil then
+cursor position will be moved to after the first quote."
+ :type 'boolean
+ :group 'emmet)
+
(defun emmet-insert-and-flash (markup)
(emmet-remove-flash-ovl (current-buffer))
(let ((here (point)))