Skip to content

Bracket was added on wrong position #4279

Open
@Chris2011

Description

@Chris2011

Apache NetBeans version

Apache NetBeans 14

What happened

Take this piece of code

const teste = {
    tester: {
        test: 2
    }
};

When you remove the closing bracket on line 4 and delete all spaces and so that the cursor is on line start and hit "}" to readd the closing bracket, it will be added right under the first token letter of test and not on the position where it was expected which is the same indentation column as tester started.

wrong-formatting-closing-bracket

How to reproduce

  • Open/Create a new JS file inside an HTML5 Project
  • Type the example code in
  • Go to the line with the closing bracket after the property test
  • Remove the closing bracket
  • Remove all spaces and set cursor to the start of the line
  • hit "}" to add the closing bracket again
  • See that the closing bracket is at the wrong column (please see my little screencast)

Did this work correctly in an earlier version?

No

Operating System

Windows 11

JDK

OpenJDK Runtime Environment 14+36-1461

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

All that I tested was with a fresh and clean installation of Apache NetBeans 14.

Are you willing to submit a pull request?

No

Code of Conduct

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    JavaScript[ci] enable web job and extra JavaScript tests (webcommon/javascript2.editor)kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions