* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle the

inconsistent second element of the list returned by
`smie-indent--parent'.
(ruby-font-lock-keywords): Disqualify any identifier before `=' as
method call.
This commit is contained in:
Dmitry Gutov 2014-02-23 10:26:40 +02:00
parent 62f9502226
commit dfdb365c4c
3 changed files with 17 additions and 4 deletions

View file

@ -2,6 +2,10 @@
* progmodes/ruby-mode.el (ruby-smie-rules): Don't indent specially
after `=>' (bug#16811).
(ruby-smie-rules): Handle the inconsistent second element of the
list returned by `smie-indent--parent'.
(ruby-font-lock-keywords): Disqualify any identifier before `=' as
method call.
2014-02-23 Juanma Barranquero <lekktu@gmail.com>

View file

@ -630,9 +630,11 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(save-excursion
;; Traverse up the parents until the parent is "." at
;; indentation, or any other token.
(while (and (progn
(goto-char (1- (cadr (smie-indent--parent))))
(not (ruby-smie--bosp)))
(while (and (let ((parent (smie-indent--parent)))
(goto-char (cadr parent))
(save-excursion
(unless (integerp (car parent)) (forward-char -1))
(not (ruby-smie--bosp))))
(progn
(setq smie--parent nil)
(smie-rule-parent-p "."))))
@ -2061,7 +2063,7 @@ See `font-lock-syntax-table'.")
"refine"
"using")
'symbols))
(1 (unless (looking-at " *\\(?:[]|,.)}]\\|$\\)")
(1 (unless (looking-at " *\\(?:[]|,.)}=]\\|$\\)")
font-lock-builtin-face)))
;; Kernel methods that have no required arguments.
(,(concat

View file

@ -357,6 +357,13 @@ def qux
.lose(
q, p)
a.records().map(&:b).zip(
foo)
# FIXME: This is not consistent with the example below it, but this
# ofset only happens if the colon is at eol, which wouldn't be often.
# Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
# distinguish from a variable reference inside a ternary operator.
foo(bar:
tee)