From 1629a329975b1c1e49249dd1462ce56a8840b0be Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 9 Nov 2013 01:59:56 +0200 Subject: * 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. --- lisp/progmodes/ruby-mode.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp/progmodes/ruby-mode.el') 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) -- cgit v1.2.3