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

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

bug#16811: 24.3.50; [ruby-mode] Implicit hash indentation bug


From: Stefan Monnier
Subject: bug#16811: 24.3.50; [ruby-mode] Implicit hash indentation bug
Date: Thu, 20 Feb 2014 09:11:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> The problem seems to be that (let (smie--parent) (smie-indent--parent))

Which does little more than (smie-backward-sexp 'halfsexp) in this case.

> called between "=>" and "{" doesn't stop at "=>", but goes straight to
> the parent "{".

Which seems correct.

> Not sure how to fix that best with the current grammar.  Stefan?

I haven't followed the ruby-smie code lately, so I'm a bit lost.  But on
the surface I'd say you might want to use (smie-rule-prev-p "=>")?

This said, I don't understand why

   {
     'HashSyntax' => {
       'EnforcedStyle'   => 'ruby19',
       'SupportedStyles' => %w(ruby19 hash_rockets)
     },
     'SpaceAroundOperators' => { 'Enabled' => true }
   }

is indented differently from

   {'HashSyntax' => {
                     'EnforcedStyle'   => 'ruby19',
                     'SupportedStyles' => %w(ruby19 hash_rockets)
                   },
    'SpaceAroundOperators' => {
      'Enabled' => true }}

It seems like "it jumps back to { instead of =>" is not the full explanation.


        Stefan





reply via email to

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