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

JS/JSX comment toggle #227

Closed kud closed 5 years ago

kud commented 5 years ago

It does not work here. French azerty keyboard.

Nothing happens on JSX.

kud commented 5 years ago

Apparently you should use forward_slash instead of / to be compliant with all types of i18n keyboards. Seen in the default key bindings in sublime text.

borela commented 5 years ago

Does it happen everytime or a specific block of code?

kud commented 5 years ago

naomi_toggle_jsx_comment was never triggered in fact.

I changed my own preferences and now it works:

{
    "keys": ["super+shift+:"],
    "command": "naomi_toggle_jsx_comment",
    "args":
    {
      "block": false
    },
    "context": [
    {
      "key": "selector",
      "operator": "equal",
      "operand": "source.js, source.jsx",
      "match_all": true
    }]
  },
  {
    "keys": ["super+shift+alt+:"],
    "command": "naomi_toggle_jsx_comment",
    "args":
    {
      "block": true
    },
    "context": [
    {
      "key": "selector",
      "operator": "equal",
      "operand": "source.js, source.jsx",
      "match_all": true
    }]
  }

something weird is that shift+: is normally translated via forward_slash but it doesn't work.

See the default key binding:

    { "keys": ["super+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
    { "keys": ["super+alt+forward_slash"], "command": "toggle_comment", "args": { "block": true } },

However, you probably should use forward_slash to be i18n keyboard compliant but it sounds that it doesn't work so I don't know.

I've got to translate all your key bindings however now, and I don't know how you could fix it to be fair.