[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 dbfbedd 2/2: Do not tokenize a comment before con
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] emacs-25 dbfbedd 2/2: Do not tokenize a comment before continuation as '; ' |
Date: |
Tue, 15 Mar 2016 01:16:56 +0000 |
branch: emacs-25
commit dbfbedd3d0f3afcfb811eae0e1a7b1c33fb27735
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Do not tokenize a comment before continuation as ';'
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
Account for a comment right after point.
---
lisp/progmodes/ruby-mode.el | 2 +-
test/indent/ruby.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 35d0cc4..edd89b3 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -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)
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index 6793bfd..85f2708 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -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 = {