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.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 3308651b0e3..51117e59f78 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -779,15 +779,15 @@ The style of the comment is controlled by `ruby-encoding-magic-comment-style'."
779(defun ruby--electric-indent-p (char) 779(defun ruby--electric-indent-p (char)
780 (cond 780 (cond
781 ((memq char ruby--electric-indent-chars) 781 ((memq char ruby--electric-indent-chars)
782 ;; Outdent after typing a closing paren. 782 ;; Reindent after typing a char affecting indentation.
783 (ruby--at-indentation-p (1- (point)))) 783 (ruby--at-indentation-p (1- (point))))
784 ((memq (char-after) ruby--electric-indent-chars) 784 ((memq (char-after) ruby--electric-indent-chars)
785 ;; Reindent after inserting something before a closing paren. 785 ;; Reindent after inserting something in front of the above.
786 (ruby--at-indentation-p (1- (point)))) 786 (ruby--at-indentation-p (1- (point))))
787 ((or (memq (char-syntax char) '(?w ?_))) 787 ((or (and (>= char ?a) (<= char ?z)) (memq char '(?_ ?? ?! ?:)))
788 (let ((pt (point))) 788 (let ((pt (point)))
789 (save-excursion 789 (save-excursion
790 (skip-syntax-backward "w_") 790 (skip-chars-backward "[:alpha:]:_?!")
791 (and (ruby--at-indentation-p) 791 (and (ruby--at-indentation-p)
792 (looking-at (regexp-opt (cons "end" ruby-block-mid-keywords))) 792 (looking-at (regexp-opt (cons "end" ruby-block-mid-keywords)))
793 ;; Outdent after typing a keyword. 793 ;; Outdent after typing a keyword.