aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmihica <smihica@gmail.com>2013-09-10 19:05:04 +0900
committersmihica <smihica@gmail.com>2013-09-10 19:05:04 +0900
commit241dd10f305016bacac7b61190ddb0c102eba64d (patch)
tree4ebe3f13a0b4865482f522287a8a4f90d155d46e
parent3c1de0e8d144ac8a2162efee4c4dde5ce3dede21 (diff)
downloademmet-mode-241dd10f305016bacac7b61190ddb0c102eba64d.tar.lz
emmet-mode-241dd10f305016bacac7b61190ddb0c102eba64d.tar.xz
emmet-mode-241dd10f305016bacac7b61190ddb0c102eba64d.zip
Fixed a bug that the cursor doesn't move after expanding without preview.
-rw-r--r--emmet-mode.el15
-rw-r--r--index.html0
-rw-r--r--src/comments.el4
-rw-r--r--src/init.el2
-rw-r--r--src/mode-def.el9
5 files changed, 20 insertions, 10 deletions
diff --git a/emmet-mode.el b/emmet-mode.el
index 09a6b23..78bd280 100644
--- a/emmet-mode.el
+++ b/emmet-mode.el
@@ -3,10 +3,10 @@
;; Copyright (C) 2013- Shin Aoyama
;; Copyright (C) 2009-2012 Chris Done
-;; Version: 1.0.2
+;; Version: 1.0.3
;; Author: Shin Aoyama <smihica@gmail.com>
;; URL: https://github.com/smihica/emmet
-;; Last-Updated: 2013-06-23 Sun
+;; Last-Updated: 2013-09-10 Tue
;; Keywords: convenience
;; This file is free software; you can redistribute it and/or modify
@@ -65,7 +65,7 @@
;;
;;; Code:
-(defconst emmet-mode:version "1.0.2")
+(defconst emmet-mode:version "1.0.3")
(eval-when-compile (require 'cl))
@@ -3375,9 +3375,14 @@ For more information see `emmet-mode'."
(let ((markup (emmet-transform (first expr))))
(when markup
(let ((pretty (emmet-prettify markup (current-indentation))))
- (save-excursion
+ (when pretty
(delete-region (second expr) (third expr))
- (emmet-insert-and-flash pretty))))))))))
+ (emmet-insert-and-flash pretty)
+ (when (and emmet-move-cursor-after-expanding (= (elt pretty 0) ?<))
+ (let ((p (point)))
+ (goto-char
+ (+ (- p (length pretty))
+ (emmet-html-next-insert-point pretty))))))))))))))
(defvar emmet-mode-keymap nil
"Keymap for emmet minor mode.")
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/index.html
diff --git a/src/comments.el b/src/comments.el
index f53f9d4..fec9d65 100644
--- a/src/comments.el
+++ b/src/comments.el
@@ -3,10 +3,10 @@
;; Copyright (C) 2013- Shin Aoyama
;; Copyright (C) 2009-2012 Chris Done
-;; Version: 1.0.2
+;; Version: 1.0.3
;; Author: Shin Aoyama <smihica@gmail.com>
;; URL: https://github.com/smihica/emmet
-;; Last-Updated: 2013-06-23 Sun
+;; Last-Updated: 2013-09-10 Tue
;; Keywords: convenience
;; This file is free software; you can redistribute it and/or modify
diff --git a/src/init.el b/src/init.el
index 98aa4cf..3fece4b 100644
--- a/src/init.el
+++ b/src/init.el
@@ -2,7 +2,7 @@
;;
;;; Code:
-(defconst emmet-mode:version "1.0.2")
+(defconst emmet-mode:version "1.0.3")
(eval-when-compile (require 'cl))
diff --git a/src/mode-def.el b/src/mode-def.el
index 35a820e..c5cce80 100644
--- a/src/mode-def.el
+++ b/src/mode-def.el
@@ -65,9 +65,14 @@ For more information see `emmet-mode'."
(let ((markup (emmet-transform (first expr))))
(when markup
(let ((pretty (emmet-prettify markup (current-indentation))))
- (save-excursion
+ (when pretty
(delete-region (second expr) (third expr))
- (emmet-insert-and-flash pretty))))))))))
+ (emmet-insert-and-flash pretty)
+ (when (and emmet-move-cursor-after-expanding (= (elt pretty 0) ?<))
+ (let ((p (point)))
+ (goto-char
+ (+ (- p (length pretty))
+ (emmet-html-next-insert-point pretty))))))))))))))
(defvar emmet-mode-keymap nil
"Keymap for emmet minor mode.")