Commit 1629a329 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):

Not after "||".
(ruby-smie-rules): Indent non-hanging "begin" blocks as part of
their parent.
parent ad16897c
2013-11-08 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
Not after "||".
(ruby-smie-rules): Indent non-hanging "begin" blocks as part of
their parent.
2013-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/ruby-mode.el: Don't require cl any more. Use pcase instead.
......
......@@ -364,6 +364,8 @@ explicitly declared in magic comment."
(and (eq (char-before) ?=)
(string-match "\\`\\s." (save-excursion
(ruby-smie--backward-token))))
(and (eq (char-before) ?|)
(eq (char-before (1- (point))) ?|))
(and (eq (car (syntax-after (1- (point)))) 2)
(member (save-excursion (ruby-smie--backward-token))
'("iuwu-mod" "and" "or")))
......@@ -546,6 +548,9 @@ explicitly declared in magic comment."
"+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^="
"<<=" ">>=" "&&=" "||=" "and" "or"))
(if (smie-rule-parent-p ";" nil) ruby-indent-level))
(`(:before . "begin")
(unless (save-excursion (skip-chars-backward " \t") (bolp))
(smie-rule-parent)))
))
(defun ruby-imenu-create-index-in-block (prefix beg end)
......
......@@ -285,9 +285,14 @@ def bar
end
end
# Failing with SMIE:
foo ||
begin
bar
end
def qux
foo ||= begin
bar
tee
end
end
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