GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bad indentation of hash with symbol-array literal values · Issue #427 · vim-ruby/vim-ruby

Bad indentation of hash with symbol-array literal values #427

New issue
Copy link
New issue
Copy link
Open
Open
Bad indentation of hash with symbol-array literal values#427
Copy link

Description

@owst
owst
opened on Oct 22, 2020
Issue body actions

Using e367f7b the following code is misindented:

x_to_y_mapping = {
  'x_one' => %i[
    y_one
    y_two
  ],
  'x_two' => %i[
    y_three
    y_four
  ]
}

becomes:

x_to_y_mapping = {
  'x_one' => %i[
  y_one
  y_two
  ],
    'x_two' => %i[
  y_three
  y_four
  ]
}

the issues as I see it being:

  1. The symbol-array literal elements are dedented to align with the hash key
  2. The second key is indented relative to the first key

N.b. the following is correctly indented:

x_to_y_mapping = {
  'x_one'=> [
    :y_one,
    :y_two
  ],
  'x_two' => [
    :y_three,
    :y_four
  ]
}

Activity

  1. zhengpd commented on Oct 26, 2021

    @zhengpd
    zhengpd
    on Oct 26, 2021
    More actions

    Same issue here. Every time I need to manually fix the indentation after doing ==. Really annoying. Anyone has solution/workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.