Project

General

Profile

Backport #718

Emacs ruby-mode does not show comment #@var correctly

Added by gettalong (Thomas Leitner) almost 11 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
[ruby-core:19720]

Description

=begin
Normal comments are shown correctly, ie. correctly colored. However, when commenting an instance variable without a
leading space, the color of the comment is the same as the color of an uncommented instance variable.

To reproduce, type the following in Emacs in a buffer with ruby-mode:

# this does work
# @var this does also work (shown in comment color)
#@var this does not work (shown in instance variable color)
=end

History

#1

Updated by shyouhei (Shyouhei Urabe) over 10 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

#2

Updated by m (m .) almost 10 years ago

=begin
This is because #@ and #$ are not always comments. An example:

  $ ruby -e '$f = "world"; puts "hello #$f"'
  # => hello world

This also applies to class variables.

The mode could be changed to make sure that it parses #@/#$ as a comment only if it's not inside a string (I don't know about any other edge cases like the one noted above).
=end

#3

Updated by shyouhei (Shyouhei Urabe) almost 9 years ago

  • Status changed from Open to Assigned
  • ruby -v set to N/A

=begin

=end

Updated by dgutov (Dmitry Gutov) over 6 years ago

Fixed in Emacs, to be released in 24.3.

#5

Updated by jeremyevans0 (Jeremy Evans) about 1 month ago

  • ruby -v deleted (N/A)
  • Status changed from Assigned to Closed
  • Description updated (diff)
  • Project changed from Ruby 1.8 to Backport187
  • Tracker changed from Bug to Backport

Also available in: Atom PDF