summaryrefslogtreecommitdiff
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2013-11-09 01:59:56 +0200
committerDmitry Gutov <dgutov@yandex.ru>2013-11-09 01:59:56 +0200
commit1629a329975b1c1e49249dd1462ce56a8840b0be (patch)
tree6d1270eafa675267348ab78a652ca5f70f518311 /lisp/progmodes/ruby-mode.el
parentad16897ceb05aefe3e6d63a6c9c5366ad0d75961 (diff)
downloademacs-1629a329975b1c1e49249dd1462ce56a8840b0be.tar.gz
* 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.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 69c850255d0..cb5fe11ada6 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -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)