GNU bug report logs - #16811
24.3.50; [ruby-mode] Implicit hash indentation bug

Previous Next

Package: emacs;

Reported by: Bozhidar Batsov <bozhidar <at> batsov.com>

Date: Wed, 19 Feb 2014 17:46:01 UTC

Severity: minor

Found in version 24.3.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 16811 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Bozhidar Batsov <bozhidar <at> batsov.com>
Cc: 16811 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#16811: 24.3.50; [ruby-mode] Implicit hash indentation bug
Date: Thu, 20 Feb 2014 08:22:08 +0200
Bozhidar Batsov <bozhidar <at> batsov.com> writes:

> Should be:
>
> method('HashSyntax' => {
>          'EnforcedStyle'   => 'ruby19',
>          'SupportedStyles' => %w(ruby19 hash_rockets)
>        },
>        'SpaceAroundOperators' => { 'Enabled' => true })
>
> The fact that the hash is implicit (lacking {}) seems to mess with the
> indentation logic.

Not really. The corresponding example with explicit hash would be

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

and it has the same problem.

The problem seems to be that (let (smie--parent) (smie-indent--parent))
called between "=>" and "{" doesn't stop at "=>", but goes straight to
the parent "{".

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




This bug report was last modified 11 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.