You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Christian Lenz (JIRA)" <ji...@apache.org> on 2018/03/01 15:57:00 UTC

[jira] [Created] (NETBEANS-436) Please change behaviour of commenting lines

Christian Lenz created NETBEANS-436:
---------------------------------------

             Summary: Please change behaviour of commenting lines
                 Key: NETBEANS-436
                 URL: https://issues.apache.org/jira/browse/NETBEANS-436
             Project: NetBeans
          Issue Type: Improvement
          Components: editor - Formatting &amp; Indentation, editor - Other
    Affects Versions: Next
            Reporter: Christian Lenz


Atm, if you hit a shortcut to comment a like, it will end up this:

{code}
if(whatever) {
   if(again) {
      console.log(42);
//    System.out.println(42);
   }
}
{code}

I know it is not the same lang but it doesn't matter. As you can see, it will comment the line, but it will start the comments still on column 1 and not where the code is. This is a pain in the ass, because if you reformat the code, it looks like this:

{code}
if(whatever) {
   if(again) {
      console.log(42);
      //    System.out.println(42);
   }
}
{code}

and if you uncomment the line, it looks like this:

{code}
if(whatever) {
   if(again) {
      console.log(42);
          System.out.println(42);
   }
}
{code}

and you have to reformat it again or move it into the right direction. I know that it was easy to add the comments in column 1 but no editor or IDE does this. In VS Code and the JetBrains family it looks like this:

{code}
if(whatever) {
   if(again) {
      console.log(42);
      // System.out.println(42);
   }
}
{code}

Which is more right, it only adds "// " in front of the code and removes it again. So in my opinion this is way better and even correct. It keeps the indentation too so no need to worry after you reformat the code.


Cheers

Chris



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists