]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not tokenize a comment before continuation as ';'
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 15 Mar 2016 01:15:18 +0000 (03:15 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 15 Mar 2016 01:16:27 +0000 (03:16 +0200)
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
Account for a comment right after point.

lisp/progmodes/ruby-mode.el
test/indent/ruby.rb

index 35d0cc44ed8c252d2046c6bece1d7c02d8ee5878..edd89b30c9f901e24aa71a77050b971f94738acc 100644 (file)
@@ -443,7 +443,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
                   (member (save-excursion (ruby-smie--backward-token))
                           '("iuwu-mod" "and" "or")))
              (save-excursion
-               (forward-comment 1)
+               (forward-comment (point-max))
                (looking-at "&?\\."))))))
 
 (defun ruby-smie--redundant-do-p (&optional skip)
index 6793bfdec2a8713d9183fea4d10de058c08119e7..85f2708bd98852c6f3e0e389c2f9e08b6ff49a35 100644 (file)
@@ -222,7 +222,7 @@ foo.
   bar
 
 # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206
-foo
+foo # comment intended to confuse the tokenizer
   .bar
 
 z = {