From: Dmitry Gutov Date: Mon, 9 Dec 2013 04:19:16 +0000 (+0200) Subject: * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~498 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8212d9c0da266e8bfb9100385113e0d7e744041e;p=emacs.git * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t after the end of a percent literal. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6e2631887ad..ae0dcc3de32 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-12-09 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t + after the end of a percent literal. + 2013-12-09 Cameron Desautels (tiny change) * progmodes/ruby-mode.el (ruby-forward-string): Document. Handle diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index fe36e725426..af7a4d8c321 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -362,8 +362,8 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." (and (memq (char-before) '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\{ ?\\ ?& ?> ?< ?% ?~ ?^)) - ;; Make sure it's not the end of a regexp. - (not (eq (car (syntax-after (1- (point)))) 7))) + ;; Not the end of a regexp or a percent literal. + (not (memq (car (syntax-after (1- (point)))) '(7 15)))) (and (eq (char-before) ?\?) (equal (save-excursion (ruby-smie--backward-token)) "?")) (and (eq (char-before) ?=) diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index a3ab73bcfb5..3c4d68a97bf 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -299,3 +299,6 @@ def qux tee end end + +%^abc^ +ddd