-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Show infobox to hint textobjects with mi
and ma
#1686
Show infobox to hint textobjects with mi
and ma
#1686
Conversation
I cleaned up a bug that was swallowing input if you cancelled with escape while in the middle of a |
Also added the pending keys below the status bar. This should help in cases where people turn off the info box in their config. I can remove that part as it's a bit hackier than the rest. Let me know and i'll force push to remove it and maybe open a separate pr after this one is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally every textobject would be split into it's on bindable function so that #1595 gets completely resolved (and we would not have to manually show the infobox either). But it's currently blocked on not being able to execute a fallback function if none of the keys match, which would be required to make the surround objects like mi(
work. I think it's good enough as a temporary solution (at the risk of it slipping into being the permanent solution :P).
Showing pending keys should also be ideally reworked to automatically work based on if there's an on_next_key
callback registered. This has the benefit of working everywhere like f
, mi
, etc.
I think we should just add a function for each of these rather than having a fallback. An exhaustive list should work fine like kakoune, then we don't have to handle wildcard. |
Defining a function for every single surround pair ( |
I agree with @sudormrfbin on this. Another case where it is useful is if you have an I've been mulling over how to refactor to address the other feedback. I'm probably a couple days away from being able to fully address. |
That is good too but not every places uses the same method, I have seen some text that uses ` and ' for opening and closing quote and we have no way around that. Yeah, I guess we could have a fallback, IIRC I did fallback for the older paragraph pull request I sent but I scraped that changes. |
The wording could probably be a little more clear, but I wanted to keep it short but still accurate.
This is a bit hacky as it makes use of global state which will end up managed in multiple places, but has precedent in the way autoinfo works. There should probably be a bigger refactor to handle this kind of state better.
b97d9bf
to
5a817bc
Compare
I don't have the bandwidth to do this level of refactor yet. Hoping we can get this in as a first pass and revisit later. |
We should probably add to the status area as well, but this is a significant improvement in discoverability for textobject surround selection.