apache / apache/netbeans

Cannot auto indent in C++

Open
#4,727 1 comment 0 reactions 0 assignees View on GitHub
C/C++ kind:bug
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 15

### What happened

When developing in a C++ file and hitting 'enter' to add a new line of code, the text cursor does not respect the current indentation. Instead, the text cursor starts from the beginning of the line.

https://user-images.githubusercontent.com/1699315/193558138-ee2b6422-a163-4fcb-971e-b1c6153e3480.mp4

![netbeans](https://user-images.githubusercontent.com/1699315/193558195-37d20358-0c44-4489-9da0-eaed50da69e3.png)

### How to reproduce

Create a new C++ project: File -> Create new Project -> C/C++ -> Lightweight C/C++ Project

Once the project is created, create a new C++ file and start coding on it. You will see the auto indentation is not respected.

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Ubuntu 20.04.5 (Kernel version 5.4.0-126-generic)

### JDK

11.0.16

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

This bug occurs every time.

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by creating a Lightweight C/C++ Project, opening a new C++ file, and pressing Enter while coding. Trace the C++ editor's indentation handling; done means a new line preserves the current indentation instead of starting at column zero.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.