Skip to content

Commit

Permalink
fix attribute-insert
Browse files Browse the repository at this point in the history
  • Loading branch information
fxbois committed Oct 17, 2017
1 parent e38fb9a commit 4754211
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions web-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

;; Copyright 2011-2017 François-Xavier Bois

;; Version: 15.0.14
;; Version: 15.0.15
;; Author: François-Xavier Bois <fxbois AT Google Mail Service>
;; Maintainer: François-Xavier Bois
;; Package-Requires: ((emacs "23.1"))
Expand All @@ -24,7 +24,7 @@

;;---- CONSTS ------------------------------------------------------------------

(defconst web-mode-version "15.0.14"
(defconst web-mode-version "15.0.15"
"Web Mode version.")

;;---- GROUPS ------------------------------------------------------------------
Expand Down Expand Up @@ -10659,7 +10659,7 @@ Prompt user if TAG-NAME isn't provided."
(interactive)
(let (attr attr-name attr-value)
(cond
((not (eq (get-text-property (point) 'tag-type) 'start))
((not (member (get-text-property (point) 'tag-type) '(start void)))
(message "attribute-insert ** invalid context **"))
((not (and (setq attr-name (read-from-minibuffer "Attribute name? "))
(> (length attr-name) 0)))
Expand All @@ -10669,9 +10669,11 @@ Prompt user if TAG-NAME isn't provided."
(when (setq attr-value (read-from-minibuffer "Attribute value? "))
(setq attr (concat attr "=\"" attr-value "\"")))
(web-mode-tag-end)
(re-search-backward "/?>")
(if (looking-back "/>")
(backward-char 2)
(backward-char))
(insert attr)
)
) ;t
) ;cond
))

Expand Down

0 comments on commit 4754211

Please sign in to comment.