-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Auto highlight selected #397
Conversation
@willothy thoughts? |
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.
Looks good to me so far, but you're not setting the highlight, just the cursor :)
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.
Ready for review
I assume, given the direction that this will need adjusting to pull the logic out of UI I would guess the best way is to make toggle_quick_menu() take a second optional param of CurrentItem which is used for the highlighting/focus logic Then a function passed back from the API get_current() which contains the logic for determining the name of the current item |
so i am going to be removing all highlighting from Harpoon and i am going to start emitting out events with win/buf id, and perhaps some extra state such that you can add whatever highlights you wish i don't want harpoon having too much logic. So i am "likely" not going to accept any PRs that add logic but instead adding hooks |
This does raise an important point (even if the highlighting is removed from this PR). Not sure how I didn't think of this before, but what if the list items aren't paths? I think that if there is going to be a way to determine the current item, it needs to be a method on the List Config so that different lists can modify the default behavior. It also needs to be optional because for some lists (commands, for example) there is no "current" item, so it would not make sense to show one. |
@willothy there is equals and display From the UI we call display, else we call equals |
Yes, sorry I should've been more clear. I mean that we're always checking For example, say we want to make a harpoon list of packages in a project. In this example the items are still paths, yet there's no way to determine the current item (or it would be tricky, at least - you'd have to split and match the current buf path). This would get more complex if the items aren't paths at all, though I can't really think of examples of that other than I think there should be a |
yes, these things can be tricky to me its an information problem. perhaps we could provide "from_buffer" or some option to let you know whence you came |
Yes, that's perfect. A more generic way to check "is this buffer related to this item" than checking the name. |
I was just about to rewrite in Lua that SOB that I PR'd in #199 to drop the I just wanted to point out that with
I suggest you add the highlight command in your config, test drive it for a couple of days and then remove it to see if you miss it :) |
Coming back to this i think i want to go a different direction. i would like to think about how to make this a extension not something inside of harpoon. If you have an idea for an event to emit where you could hook in and do this work yourself, please do. I would have no problems with the harpoon-colors plugin doing something for me. I just don't want to maintain that :) |
if you look at |
I am planning on doing another harpoon season coming up. I just feel pulled in every direction, it's very difficult, but I'm very excited I will make sure this gets somewhat resolved |
@ThePrimeagen I can reopen the PR if you think it is still useful? It was your other direction comment made me think it was no longer relevant |
This is already possible with the events system. I've created a small plugin that adds this functionality. The actual code is so small that you can copy it to your config and save yourself a dependency. |
#396 but to the right branch
Adds request in #384