diff options
| author | Dmitry Gutov | 2016-03-15 03:15:18 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2016-03-15 03:16:27 +0200 |
| commit | dbfbedd3d0f3afcfb811eae0e1a7b1c33fb27735 (patch) | |
| tree | 0a0d6019eec4a6ad62da388c9c0685c391119be5 | |
| parent | 040362001d66fd721d3a85cddfadf8041cc23f7f (diff) | |
| download | emacs-dbfbedd3d0f3afcfb811eae0e1a7b1c33fb27735.tar.gz emacs-dbfbedd3d0f3afcfb811eae0e1a7b1c33fb27735.zip | |
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.
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 | ||||
| -rw-r--r-- | 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 35d0cc44ed8..edd89b30c9f 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'." | |||
| 443 | (member (save-excursion (ruby-smie--backward-token)) | 443 | (member (save-excursion (ruby-smie--backward-token)) |
| 444 | '("iuwu-mod" "and" "or"))) | 444 | '("iuwu-mod" "and" "or"))) |
| 445 | (save-excursion | 445 | (save-excursion |
| 446 | (forward-comment 1) | 446 | (forward-comment (point-max)) |
| 447 | (looking-at "&?\\.")))))) | 447 | (looking-at "&?\\.")))))) |
| 448 | 448 | ||
| 449 | (defun ruby-smie--redundant-do-p (&optional skip) | 449 | (defun ruby-smie--redundant-do-p (&optional skip) |
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 6793bfdec2a..85f2708bd98 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -222,7 +222,7 @@ foo. | |||
| 222 | bar | 222 | bar |
| 223 | 223 | ||
| 224 | # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206 | 224 | # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206 |
| 225 | foo | 225 | foo # comment intended to confuse the tokenizer |
| 226 | .bar | 226 | .bar |
| 227 | 227 | ||
| 228 | z = { | 228 | z = { |