From 8212d9c0da266e8bfb9100385113e0d7e744041e Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 9 Dec 2013 06:19:16 +0200 Subject: [PATCH] * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t after the end of a percent literal. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/ruby-mode.el | 4 ++-- test/indent/ruby.rb | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) 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 -- 2.11.4.GIT