openstyles / stylus

Stylus - Userstyles Manager
https://add0n.com/stylus.html
GNU General Public License v3.0
5.41k stars 305 forks source link

[Bug] Keymap sublime: `toggleCommentIndented` doesn't consider indents at all #1654

Open Phroneris opened 1 year ago

Phroneris commented 1 year ago

Bug Report

Bug Description

The sublime keymap has a command called toggleCommentIndented, which is generally assigned to the Ctrl+/ hotkey.

In spite of its name, this command comments out the entire line, including the spaces for indentation, rather than starting at the first indented character of the line.

CSS Code

Stylus syntax.

  1. Let's comment out the .comment-out-me line:

    @-moz-document domain("example.com")
     .dont-disturb-me
     .comment-out-me
       display: initial

    One of expected behaviors:

    @-moz-document domain("example.com")
     .dont-disturb-me
     // .comment-out-me
       display: initial

    Actual behavior:

    @-moz-document domain("example.com")
     .dont-disturb-me
    /*   .comment-out-me */
       display: initial
  2. Then let's comment out lines 3 and 4 at once:

    @-moz-document domain("example.com")
     .dont-disturb-me
     .comment-out-me
       content: "And me!"
       display: initial

    One of expected behaviors:

    @-moz-document domain("example.com")
     .dont-disturb-me
     // .comment-out-me
       // content: "And me!"
       display: initial

    Actual behavior:

    @-moz-document domain("example.com")
     .dont-disturb-me
    /*   .comment-out-me
       content: "And me!" */
       display: initial

System Information

Additional Context

The sublime-Mac and sublime-PC keymaps cause the same result.

This is not just a problem with the name of the command, but is an inconvenience when coding in Stylus syntax.

tophf commented 1 year ago

This is how it's implemented in CodeMirror, so I'm not sure we should fix it ourselves...

Phroneris commented 1 year ago

Oh sad news. Thanks. I await the day of realization.