Skip to content

Behaviour of ToggleCommentAction #570

@sesquialtera87

Description

@sesquialtera87

Description
ToggleCommentAction seems to act only at line start.
For example, if RSyntaxTextArea contains the following Java code I try to de-comment the second line:

private void add(int a, int b) {
    // return 2*a + b
    return a + b;
}

I get this, where another double-slash line comment is inserted, instead of beeing removed.

private void add(int a, int b) {
//    // return 2*a + b
    return a + b;
}

Expected behavior
It would seem appropriate for ToggleCommentAction to identify a comment regardless of the leading whitespaces preceding the comment marker.

Java version
OpenJDK 18.0.2

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions