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

Implementation of "Smart" toggle? #5

Open
cotwitch opened this issue Mar 24, 2021 · 1 comment
Open

Implementation of "Smart" toggle? #5

cotwitch opened this issue Mar 24, 2021 · 1 comment

Comments

@cotwitch
Copy link

Hi @pranshuagrawal !

I've just hitted following case while using your extension:

When you're toggling some simple single word without any "dividable parts/separators", like console for example.

Then, there are only 3 possible case-variations for that word:
console (lowercase)
Console (capitalized)
CONSOLE (uppercase)

So, is it possible to make check (after each case transformation) if transformed string is different from the original input?
When resulting string is not different (so no transformation has been actually done) then move to the next transformation in the list and apply it - until any change is made (or transformation list reaches it's end - to prevent infinite loop).

As a result - only 3 variations (described above) will be resulted while toggling the case (because dot case, header case, kebab case and others cases (which are using "word separation") will be skipped by the check).

Simply said - after this change, only transformations which would have any effect will be actually used/cycled. Does it makes sense to you @pranshuagrawal

@cotwitch cotwitch closed this as completed Nov 9, 2021
@pranshuagrawal
Copy link
Owner

@cotwitch yes this definitely makes sense. Occupied in some work these days but will make the changes and let you know!

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