aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsmihica <smihica@gmail.com>2013-08-16 15:16:45 +0900
committersmihica <smihica@gmail.com>2013-08-16 15:16:45 +0900
commit032950b54561c2d82ea35adb0b91bd029843bc55 (patch)
tree8f978e37f7585b3c3e839b57c5925d88e38eb242 /src
parenta172db1fb8c63de5ae85ce48253baf69dca4b008 (diff)
downloademmet-mode-032950b54561c2d82ea35adb0b91bd029843bc55.tar.lz
emmet-mode-032950b54561c2d82ea35adb0b91bd029843bc55.tar.xz
emmet-mode-032950b54561c2d82ea35adb0b91bd029843bc55.zip
Added settings that the cursor to be positioned between first empty quotes. issue #9.
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)))