borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
557 stars 20 forks source link

Single-line commenting shifts line indent #248

Open tourman opened 4 years ago

tourman commented 4 years ago

Description

A code line is shifting while toggling comments by a shortcut. See gif: https://ibb.co/9ZGvWPj However the toggling by the dropdown from the main menu works fine.

Steps to reproduce

  1. Create empty JS file
  2. Type something in any line
  3. Toggle twice comment by a shortcut
  4. The line is shifted by a space

Expected behavior

There should be no indents after the toggling single-line comments via a shortcut.

Actual behavior

The line I try to twice toggle comment for is shifted by a space. While a shortcut console shows the following only.

command: naomi_toggle_jsx_comment {"block": false}
command: naomi_toggle_jsx_comment {"block": false}

The menu usage causes console to show this:

command: toggle_comment {"block": false}
command: toggle_comment {"block": false}

Environment

ansonlouis commented 2 years ago

I got around this by copying Sublimes default toggle_comment command over to my user pref key-bindings

{ "keys": ["super+forward_slash"], "command": "toggle_comment", "args": { "block": false } }
patrickjrm commented 2 years ago

The above fix also worked for me! Albeit switching super+forward_slash to ctrl+forward_slash for Windows behavior. Thanks!