-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
feat(picker): make the telescope harpoon-picker behave more like a builtin telescope file-picker #512
base: harpoon2
Are you sure you want to change the base?
feat(picker): make the telescope harpoon-picker behave more like a builtin telescope file-picker #512
Conversation
This commit fixes the missing `entry.index` - in the marks-extension for telescope - which caused the index to always show `nil` - or rather `n…` - due to a fixed width of 2, in the dialogue. This commit also added a dynamic width and left-padding for the index-column, so the index is being right-aligned.
These changes allow the telescope harpoon-picker to behave more like a builtin telescope file-picker. Both global and individual telescope- customizations will have an effect.
Improve the `move`- and `delete`-operations, by making them feel smoother. Also make the movements behave more like "builtin" telescope- movements.
These changes add some enhancements for the telescope |
This change allows the telescope-picker to sort by index. If one of the search-terms equals an index, it'll get a better score. Partial matches of an index, will get a slightly better score. Matches with the main entry - i.e. the filename - will always have the best score; showing them before an index-match.
Marks in lualine, custom mapping to delete marks in Telescope Also see ThePrimeagen/harpoon#512 and ThePrimeagen/harpoon#499
Marks in lualine, custom mapping to delete marks in Telescope Also see ThePrimeagen/harpoon#512 and ThePrimeagen/harpoon#499
This is great, thank you for putting up this work! |
If I can get a couple of approvals, I will merge this. Not know the telescope stuff, so I need someone who can take the lead on reviewing these changes |
This can be used to extend and override the key-mappings inside the `attach_mappings`-function, for example: ```lua local themes = require("telescope.themes") local hm_actions = require("telescope._extensions.harpoon_marks.actions") require("telescope").extensions.harpoon.marks(themes.get_dropdown({ previewer = false, layout_config = { width = 0.6 }, path_display = { truncate = 10 }, attach_mappings = function(_, map) map("i", "<c-d>", hm_actions.delete_mark_selections) map("n", "<c-d>", hm_actions.delete_mark_selections) return true end, })) ```
8673fca
to
a4f9c0b
Compare
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.
@ThePrimeagen I'm not a Telescope expert, but all I can say is this works perfectly! Thank you again @kimabrandt-flx 🙏🏽
Tried it out with this code. I don't know telescope, I just tried it out and One thing I noticed though is that if you delete an item then the Harpoon indexes will change too, but in telescope the original numbers persist. For example in Telescope: 1, 2, 3, 4, 5 --delete 2nd--> 1, 3, 4, 5 (should be 1, 2, 3, 4 - which it will be if I close and reopen the whole thing). |
I used it for few days and it doesn't work well. The ordering really breaks when deleting items and then adding new ones. There will be empty rows in the original Harpoon window. |
@11Firefox11 I think - when restarting - you could be seeing something related to these issues!? #476, #573 |
This commit fixes the missing
entry.index
- in the marks-extension for telescope - which caused the index to always shownil
- or rathern…
- due to a fixed width of 2, in the dialogue.This commit also added a dynamic width and left-padding for the index-column, so the index is being right-aligned.