Giter Site home page Giter Site logo

Comments (3)

mitchell486 avatar mitchell486 commented on June 27, 2024 1

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.

mitchell486 avatar mitchell486 commented on June 27, 2024

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:

  1. 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.
  2. If there is no recognized word, try matching a subset of characters.
  3. 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.

HiDeoo avatar HiDeoo commented on June 27, 2024

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:

demo

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.

Screenshot 2022-03-19 at 17 24 21

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.