Skip to content

R chunks starting with a single-commented line not indented on first line #24

@plantarum

Description

@plantarum

I am using the default ESS commenting system, where single comment characters are indented to comment-column. This works as expected with poly-r, except for the first line. If the first line of a chunk starts with a single comment, pressing tab indents the line to the first column. I.e., if I start from this:

```{R code-test}
# This is the first commented line
# Second comment line
1 + 1
```

Pressing tab on the first line doesn't change indentation. On the second line it does:

```{R code-test}
# This is the first commented line
                                        # Second comment line
1 + 1
```

What I expect is:

```{R code-test}
                                        # This is the first commented line
                                        # Second comment line
1 + 1
```

Is this intentional? If so, can I change it to give me the indentation I want?

My motivation is to move the comment column to column 2, so I can use single # characters to get nearly full-line comments. If I use ### comments, markdown-mode as the host mode treats these as headlines, which breaks visibility cycling.

Emacs 28.0.50
poly-R 20200316.1315

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions