-
Notifications
You must be signed in to change notification settings - Fork 28
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
Allow for case insensitivity #64
Comments
I wanted to implement However, I've been thinking about this, and - sadly! - smartcase is an impossible feature for us, by design. This is one small tradeoff of ahead-of-time labeling. A minimal example to illustrate the problem: The simpler |
Thanks for the link (my searches all included Thanks again! |
Linked this issue in the README. Let's close this for now - I doubt that we can cut the Gordian knot and come up with some groundbreaking solution to the "smart case" issue without sacrificing the core of the plugin. |
The feature is available for f/t motions, and for s/x after auto-jump to first match or cold-repeat. API change: new `opts` field `exit_after_idle_msecs`. Closes #64
Note: mistakenly referenced this issue in be9e1b4. |
I love this plugin, but I do find the lack of smartcase to be rather painful. I do not think this is impossible by design, either, as the following can be implemented (no idea about difficulty though!) without changing any of the current behavior of the plugin: If the user has the text: Whether or not the the lowercase highlights are dropped could easily be the difference between ignorecase and smartcase, and the details of cursor movement are obviously up to you, but I think it's be a really nice improvement. |
@milisims Unfortunately this would not work either, this problem is a bit like engineering a perpetuum mobile 😊 Okay, let's say that we even give the label The only (theoretical) solution would be to show two labels next to each other, but there's no point in that, obviously. Or a system with some arcane rule like: "for a label |
Subsequent matches behave identically to standard behavior regardless of smartcase, and do not need additional labeling. As for the first match of smartcase, I'm of the mind that it doesn't need a different label at all and the cursor moving into place with the uppercase letter-press is communication enough. If lowercase is used then it's already behaving correctly. That said, I can see the argument to highlighting it differently, (knowing ahead of time allows your brain to do the decision while fingers do their thing), I just don't think it's necessary. That would obviously be up to you!
The point of smartcase, as a heavy user of it (in vim-sneak as well), is to ignore case most of the time, then occasionally use the uppercase to be more specific when a situation might call for it. Going back to our example, if our target is the second
My recommendation is already able to achieve deterministic behavior with this single-label design, and would be consistent with current and ignorecase behavior (when/if implemented). I'm sure other designs can work as well, but this one seems straightforward and intuitive to me. |
All smartcase does is triggering case-sensitivity - that is, filtering out lowercase matches - when the pattern is uppercase, that's the very definition of it. I'm not sure I understand your suggestion correctly, but basically it's about implementing a smartcase-like feature that only applies to the first match? That is surprising/inconsistent behaviour level 99.
With smartcase (forget about AoT-labeling for now, let's say we're using Sneak), I should be able to reach the second |
This seems to make it clear that we're having a fair bit of miscommunication, because I can not understand how you draw that conclusion. Or I don't understand what you mean. To attempt to clear that up, I'll over-explain here (only in hopes to clear up any misunderstanding, if they exist), and if it doesn't make sense still then well, we tried 😄 Lets say our buffer is: We have smartcase enabled, and start a 2 character search. Starting with an uppercase is trivial (force case sensitive), so I'll ignore it here. Starting with lowercase, We can now press either Because the labels didn't change, the cognitive load hasn't changed, and I don't have an opinion on whether That's it, we can jump using AoT calculated labels with smartcase without changing the inherent behavior of the plugin: I look at a place I want to be, start a 2 character search and start typing those characters, and complete the search with whatever label the plugin shows me. That workflow does not change. Intuitively this design (to me, it's necessarily subjective) works similarly to smartcase searching with Now going to your ab example, The point here is that smartcase is posssible, in response to your comment about it not being possible. If you don't like the design, that's okay! Don't do it! But it's clearly possible. Going through all of this has made it clear to me that ignorecase would do functionally 3/4 of what I care about, so that's still a very helpful improvement. Anyway, I hope it is clear that I really think this plugin has an extremely cool concept, which is why I'm actually passionate enough to write all this up 😀 |
Don't get me wrong, I would be the happiest person if we could solve this, but it seems I don't follow you :) Okay, I'll grab a coffee, and try to absorb this once more... 😃 EDIT:
The group switch key (
That is not entirely out of the question (ignorecase), but I'm still skeptical of its usefulness. You cannot know beforehand when it will actually slow you down (because sometimes it will!), so it seems a bit weird to me to commit to it exclusively. |
I haven't seen a config option for this nor old issue request this, so I'm wondering if this was a consideration before.
Currently, beacons are lit only if they match the case of the characters provided. So, for example, if I want to target
None
, I have to typesNo
. I think it'd be great if there was a case insensitive option such that typingsno
would target the textNone
.The text was updated successfully, but these errors were encountered: