Commit c613f4d6 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

Fix indentation before `!=' and after `+='

Originally reported in https://github.com/mooz/js2-mode/issues/174.
* lisp/progmodes/js.el (js--indent-operator-re): Make assignments and
(in)equality operator a separate case.
(js--continued-expression-p): Escape the second `+' in the regexp.
parent 202f4941
2014-11-16 Dmitry Gutov <dgutov@yandex.ru>
Fix indentation before `!=' and after `+='. Originally reported
in https://github.com/mooz/js2-mode/issues/174.
* progmodes/js.el (js--indent-operator-re): Make assignments and
(in)equality operator a separate case.
(js--continued-expression-p): Escape the second `+' in the regexp.
2014-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
* window.el (handle-select-window): Deactivate shift-region (bug#19003).
......
......@@ -1685,7 +1685,7 @@ This performs fontification according to `js--class-styles'."
"Regular expression matching variable declaration keywords.")
(defconst js--indent-operator-re
(concat "[-+*/%<>=&^|?:.]\\([^-+*/]\\|$\\)\\|"
(concat "[-+*/%<>&^|?:.]\\([^-+*/]\\|$\\)\\|!?=\\|"
(js--regexp-opt-symbol '("in" "instanceof")))
"Regexp matching operators that affect indentation of continued expressions.")
......@@ -1712,7 +1712,7 @@ This performs fontification according to `js--class-styles'."
(save-excursion (backward-char) (not (looking-at "[/*]/")))
(js--looking-at-operator-p)
(and (progn (backward-char)
(not (looking-at "++\\|--\\|/[/*]"))))))))))
(not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
(defun js--end-of-do-while-loop-p ()
......
......@@ -47,3 +47,11 @@ var p = {
var evens = [e for each (e in range(0, 21))
if (ed % 2 == 0)];
!b
!=b
!==b
a++
b +=
c
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment