1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

* lisp/progmodes/ruby-mode.el (ruby-calculate-indent): Consider

two-character operators and whether the character preceding them
changes their meaning.

Fixes: debbugs:15208
This commit is contained in:
Dmitry Gutov 2013-09-03 03:29:10 +03:00
parent 9718b207e9
commit 88527bc0a2
3 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-09-03 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-calculate-indent): Consider
two-character operators and whether the character preceding them
changes their meaning (Bug#15208).
2013-09-02 Fabián Ezequiel Gallina <fgallina@gnu.org> 2013-09-02 Fabián Ezequiel Gallina <fgallina@gnu.org>
Format code sent to Python shell for robustness. Format code sent to Python shell for robustness.

View File

@ -137,6 +137,7 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
(defconst ruby-symbol-chars "a-zA-Z0-9_" (defconst ruby-symbol-chars "a-zA-Z0-9_"
"List of characters that symbol names may contain.") "List of characters that symbol names may contain.")
(defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]") (defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]")
"Regexp to match symbols.") "Regexp to match symbols.")
@ -935,6 +936,10 @@ Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'."
(not (looking-at "[a-z_]")))) (not (looking-at "[a-z_]"))))
(and (looking-at ruby-operator-re) (and (looking-at ruby-operator-re)
(not (ruby-special-char-p)) (not (ruby-special-char-p))
(save-excursion
(forward-char -1)
(or (not (looking-at ruby-operator-re))
(not (eq (char-before) ?:))))
;; Operator at the end of line. ;; Operator at the end of line.
(let ((c (char-after (point)))) (let ((c (char-after (point))))
(and (and

View File

@ -66,3 +66,8 @@ def test2 (arg)
Given /toto/ do Given /toto/ do
print "hello" print "hello"
end end
# Bug#15208
if something == :==
do_something
end