Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
neaumusic opened this issue Apr 26, 2019 · 4 comments
Open

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

neaumusic opened this issue Apr 26, 2019 · 4 comments
Labels

Comments

@neaumusic
Copy link

neaumusic commented Apr 26, 2019

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.

@borela borela added the bug label Apr 27, 2019
@coreyward
Copy link

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
Copy link
Contributor

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

// Close self closing JSX tag on “/”.
"keys": [ "/" ],
"command": "insert_snippet",
"args": { "contents": "/>" },
"context": [{
"key": "selector",
"operator": "equal",
"operand": "source.jsx meta.tag - (string, comment)",
"match_all": true
},{
"key": "selection_empty",
"operator": "equal",
"operand": true,
"match_all": true
},{
"key": "preceding_text",
"operator": "not_regex_contains",
"operand": "<\\s*$",
"match_all": true
},{
"key": "setting.auto_close_tags",
"operator": "equal",
"operand": true,
"match_all": true
}]
}]

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
Copy link

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

@markalfred
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants