aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index cebc1dc9823..fa94992ab79 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -420,7 +420,10 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
420 420
421(defun ruby-smie--bosp () 421(defun ruby-smie--bosp ()
422 (save-excursion (skip-chars-backward " \t") 422 (save-excursion (skip-chars-backward " \t")
423 (or (bolp) (memq (char-before) '(?\; ?=))))) 423 (or (and (bolp)
424 ;; Newline is escaped.
425 (not (eq (char-before (1- (point))) ?\\)))
426 (memq (char-before) '(?\; ?=)))))
424 427
425(defun ruby-smie--implicit-semi-p () 428(defun ruby-smie--implicit-semi-p ()
426 (save-excursion 429 (save-excursion
@@ -669,7 +672,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
669 ;; Align to the previous `when', but look up the virtual 672 ;; Align to the previous `when', but look up the virtual
670 ;; indentation of `case'. 673 ;; indentation of `case'.
671 (if (smie-rule-sibling-p) 0 (smie-rule-parent))) 674 (if (smie-rule-sibling-p) 0 (smie-rule-parent)))
672 (`(:after . ,(or "=" "iuwu-mod" "+" "-" "*" "/" "&&" "||" "%" "**" "^" "&" 675 (`(:after . ,(or "=" "+" "-" "*" "/" "&&" "||" "%" "**" "^" "&"
673 "<=>" ">" "<" ">=" "<=" "==" "===" "!=" "<<" ">>" 676 "<=>" ">" "<" ">=" "<=" "==" "===" "!=" "<<" ">>"
674 "+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^=" "|" 677 "+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^=" "|"
675 "<<=" ">>=" "&&=" "||=" "and" "or")) 678 "<<=" ">>=" "&&=" "||=" "and" "or"))
@@ -682,6 +685,8 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
682 (if (ruby-smie--indent-to-stmt-p token) 685 (if (ruby-smie--indent-to-stmt-p token)
683 (ruby-smie--indent-to-stmt) 686 (ruby-smie--indent-to-stmt)
684 (cons 'column (current-column))))) 687 (cons 'column (current-column)))))
688 (`(:before . "iuwu-mod")
689 (smie-rule-parent ruby-indent-level))
685 )) 690 ))
686 691
687(defun ruby--at-indentation-p (&optional point) 692(defun ruby--at-indentation-p (&optional point)