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

JSX symbols `>` and `/` break multiple cursors & selections #216

Open neaumusic opened 5 years ago

neaumusic commented 5 years ago

Is it possible to disable auto-close autocompletion?

  1. I usually don't want to auto-close JSX tags.

  2. any auto-close breaks multiple cursor editing, and turns into a single cursor at the first index.

coreyward commented 5 years ago

This behavior is rather disruptive; I didn't realize it was coming from Naomi. Please do either disable it by default or at least document a way to disable it in settings.

markalfred commented 5 years ago

This also breaks search (triggered by /) in Vim mode. I think some additional "contexts" need to be added to this keybinding:

https://github.com/borela/naomi/blob/a1034a85cfc8e924e1e9a181765549fb890956a8/Default.sublime-keymap#L353-L378

The additional contexts are:

// to fix the <hr/>> issue above:
{ "key": "following_text", "operator": "not_regex_contains", "operand": ">" }, 

// to fix the multi-cursor issue:
{ "key": "num_selections", "operator": "equal", "operand": 1 },

// to fix the Vim mode issue
{ "key": "setting.command_mode", "operand": false },

Note: I haven't personally tested these, so they may not be exactly right, but I believe this is the gist of it.

AlexKvazos commented 4 years ago

Can I get a pointer on where to fix this? I can give it a stab.

markalfred commented 4 years ago

@AlexKvazos my comment above outlines what I think are the correct fixes, but I haven't fully tested them myself.