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

Toggle surrounding characters while inside the expression #15

Closed
remusa opened this issue Dec 30, 2021 · 1 comment
Closed

Toggle surrounding characters while inside the expression #15

remusa opened this issue Dec 30, 2021 · 1 comment

Comments

@remusa
Copy link

remusa commented Dec 30, 2021

Would it be possible to have this toggle the next surrounding pair from the inside (without having to move to the desired character first).

What I mean is something like the Toggle Quotes extension. Basically you can be inside a string and press the key bind and it will cycle through the available quote characters without having to move to the opening/closing quote. This could also work from inside parenthesis, brackets, etc.

Example:

''Hello [cursor] world'' -> Hello [cursor] world -> 'Hello [cursor] world'
[hi there] -> {hi there}

@HiDeoo
Copy link
Owner

HiDeoo commented Mar 19, 2022

Thanks for your feedback.

I use a similar extension and tried at some point to mimic their behavior in this extension altho after multiple attempts, I decided that this was a not a good idea.

Implementing such behavior had various undesirable side effects, specially with text selections, or would even break basic features of the extension. I thought about adding this special changes only for single characters replacements or even symbols, but that would break the existing behavior for some users. I thought about adding some special shortcuts modifiers to active this new behavior but this was becoming a mess for the end-user. This was even becoming annoying when you wanted to toggle a word in a quoted sentence as there was no predictable way to know what the user wanted.

I think it's best to keep this totally different kind of toggles in two extensions, specially considering how small they are and their low impact on activation time.

@HiDeoo HiDeoo closed this as completed Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants