naomi icon indicating copy to clipboard operation
naomi copied to clipboard

Single-line commenting shifts line indent

Open tourman opened this issue 4 years ago • 2 comments

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

  • ST3 Build: 3211
  • Naomi: v4.3.2
  • Operating system and version: macOS 10.14.5

tourman avatar Mar 23 '20 12:03 tourman

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 } }

ansonlouis avatar Nov 12 '21 18:11 ansonlouis

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

patrickjrm avatar Jan 18 '22 19:01 patrickjrm