Skip to content

Commit

Permalink
Bugfix js-object-property
Browse files Browse the repository at this point in the history
 - it got confused by contracted object literals.
  • Loading branch information
magnars committed Dec 5, 2011
1 parent da7f466 commit 78dcf66
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js-mode-expansions.el
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@
(if (looking-at "\\s(")
(forward-list)
(forward-char)))
(if (looking-back "[\s\n]")
(search-backward-regexp "[^\s]"))
(when (looking-back "[\s\n]")
(search-backward-regexp "[^\s\n]")
(forward-char))
(exchange-point-and-mark))

(defun er/mark-js-object-property ()
Expand All @@ -132,8 +133,9 @@ If point is inside the value, that will be marked first anyway."
(if (looking-at "\\s(")
(forward-list)
(forward-char)))
(if (looking-back "[\s\n]")
(search-backward-regexp "[^\s]"))
(when (looking-back "[\s\n]")
(search-backward-regexp "[^\s\n]")
(forward-char))
(exchange-point-and-mark)))

(defun er/add-js-mode-expansions ()
Expand Down

0 comments on commit 78dcf66

Please sign in to comment.