FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Missing indentation after a control statement without brackets · Issue #476 · atom/language-javascript · GitHub

This repository was archived by the owner on Dec 15, 2022. It is now read-only.
/ language-javascript Public archive
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Missing indentation after a control statement without brackets #476

Description

Prerequisites

Description

If you type a control statement without opening brackets and hit enter, the indentation level is maintained rather than being increased one level:

I suspect this could be desirable if one was using brackets "BSD" style:

if (2>1)
{
  code;
}

Which I think could be handled by detecting the open bracket at the beggining of the line and immediately decreasing indentation. I don't know if the core supports this type of behavior, I'm not aware of the specifics of how auto indentation works. Otherwise, this could also be a setting for your preferred indentation style.

Steps to Reproduce

  1. Type `if (2>1)``
  2. Press enter

Expected behavior: Second line indentation level should be increased.

Actual behavior: Second line indentation level is the same.

Reproduces how often: 100%

Versions

Atom : 1.12.7
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0

apm 1.12.9
npm 3.10.5
node 4.4.5
python
git
visual studio 2013

Windows 8.1

Additional Information

Furthermore, there's a related issue with the indentation of closing brackets involving a similar situation:

This appears to be because the closing bracket always decreases indentation by one level. The correct behavior should be to return to the indentation level of the opening bracket, regardless of the current indentation. Again I'm not sure if this is a language-javascript level issue, or a more general core issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL