atom / language-c

C support in Atom
Other
118 stars 153 forks source link

Space after comment in C not correct #272

Open nebulaM opened 6 years ago

nebulaM commented 6 years ago

Prerequisites

Description

I use 4 spaces in my VS code setting by default, but after using / for a comment, press enter key gives me 3 spaces instead 4 spaces. Only happens when / is on a separate line.

Example 1:

    /* This is a comment*/
    | <- 4 spaces after pressing enter key, nothing abnormal.

Example 2:

    /*
    ** This is a comment
    */
   |  <- 3 spaces after pressing enter key, although I have 4 spaces in my setting.

Steps to Reproduce

  1. See above, Example 2.

Expected behavior: Always 4 spaces after pressing enter key because that is what in my setting.

Actual behavior: 3 spaces after pressing enter key, if prev line is */.

Reproduces how often: All the time when this One Dark Pro theme is enabled. Not reproducible without One Dark Pro theme.

Versions

You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running. VS code 1.22 One Dark Pro 2.13.4

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Note: Edited by @Arcanemagus to make formatting of the examples clear.

Arcanemagus commented 6 years ago

It looks like this is due to your non-standard comment style.

Most of the time comments are written as:

    /*
     * This is a comment
     */
    | <- 4 spaces after pressing enter key, nothing abnormal.

It seems that the way it is working currently is just doing "one space less than the beginning of the last line".