bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string litera


From: Dmitry Gutov
Subject: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal
Date: Thu, 11 Aug 2016 06:10:22 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Thunderbird/47.0

Hi!

On 08/08/2016 06:50 AM, Ryo Furue wrote:

1. Open an empty Ruby source code, say "tmp.rb".
2. Type the following:

#!/usr/bin/ruby
base = ?a.ord - 1

On hitting the return key at the end of the second line, the cursor
moves below "a", not to the top of the third line. The indentation
state seems to be confused.  I did this test with "emacs -q" .

Thanks for the report. I'd like to fix it sometime, but it's not a big priority, considering this syntax is usually discouraged:

https://github.com/bbatsov/ruby-style-guide#no-character-literals

?a is a valid Ruby syntax for string literal.  After writing this, I learned
that "a".ord is equivalent (I think)

Yes, in Ruby 1.9 and newer, it's a full equivalent.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]