Comments (3)
Did you add some custom toggles like one switching a n (no first letter maybe?) to a y (yes first letter maybe?)?
Yup! I 100% did that And it makes perfect sense that this would take precedence and ruin the normal toggle. I'll likely remove that Y/N one that I have, since it causes this weird behavior. Thanks again for the great extension, I use it daily!
from toggler-vscode.
I should have tested more, because I just found out what is happening. This is the same behavior described in Issue #1, however this is only happening when the cursor is at the end of the word.
If I select the entire word, it works as expected. I suspect this is a tough nut to crack, because if this were to behave how I originally expected, I assume you would have to:
- Recognize and match until the beginning AND end of the current word, so if the cursor position were in the middle of a word, you'd have to go both directions. If it's in front of the word, go until you find a space behind, and vice versa for my case.
- If there is no recognized word, try matching a subset of characters.
- If there is no recognized subset of characters, match a single character.
I'm not sure you want to implement this feature. Sounds like a lot of work for minimal reward of babysitting silly end users like myself! 😂 So, if you would like to close this issue with expected behavior, I will completely understand! I will leave it open for now in case you want to do anything with it. Thank you again for the wonderful tool! 🙏 👍
from toggler-vscode.
Thanks for your feedback, glad you like the extension :)
Did you add some custom toggles like one switching a n
(no
first letter maybe?) to a y
(yes
first letter maybe?)? I cannot manage to repro the issue on my end:
Such a toggle could take precedence over the default on
-> off
toggle.
The order of the toggles is very important as more important ones should be defined before less important ones. This is visible in the default toggles for example where ["onFocus", "onBlur"]
is defined before ["on", "off"]
. If this was not the case, having the cursor before the word onFocus
and triggering a toggle would bring to the world the beautiful offFocus
when you obviously want onBlur
^^
This is also the reason why I added to the extension a setting to use or not the default toggles bundled with the extension, so that the rare users who would need a totally different configuration could still use the extension.
Regarding finding a way to fix this issue properly, for all cases, without breaking the current behavior, why still being able to customize all toggles, this is a problem going back to 2017 with a similar Atom extension I developed at the time considering the APIs available in the editors without adding too much complexity to the code.
from toggler-vscode.
Related Issues (11)
- Toggling without selecting a word will toggle only a subset of the word if it matched first HOT 1
- toggleable notification HOT 5
- Toggle surrounding characters while inside the expression HOT 1
- Feature request: add a option or shortcut to "toggle-reverse",thanks HOT 5
- Bug:uppercase => lowercase HOT 1
- Default toggles addition HOT 1
- Workspace and folder settings HOT 1
- Toggling on a camel case word should not handle sub-words that don't follow the camel case HOT 1
- Inconsistent/confusing handling of cursor position HOT 2
- Removing/replacing defaults HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toggler-vscode.