WIP: builtin add tagstack function#210
WIP: builtin add tagstack function#210DevonMorris wants to merge 2 commits intonvim-telescope:masterfrom
Conversation
| opts = opts or {} | ||
| local tagstack = vim.fn.gettagstack() | ||
| if vim.tbl_isempty(tagstack.items) then | ||
| return |
There was a problem hiding this comment.
probably should print a message "No tagstack available" or similar.
| return | ||
| end | ||
|
|
||
| for i, value in pairs(tagstack.items) do |
There was a problem hiding this comment.
you should use ipairs when iterating over an array-like table.
| -- reverse the list | ||
| tags = {} | ||
| for i=#tagstack.items, 1, -1 do | ||
| tags[#tags+1] = tagstack.items[i] |
There was a problem hiding this comment.
you can use table.insert(tags, tagstack.items[i]) for simpler lua.
|
You had originally mentioned doing some stuff with manipulating the tagstack, are you still interested in doing that? |
|
Yeah I'm definitely still interested in manipulating the tagstack based on the chosen tag. Specifically, I'd like
I'm really unsure where to begin when it comes to implementing those features. I've taken a cursory look at Edit: Maybe Edit edit: I played around with this a bit more looks like you can't call |
|
So the first part (setting it to be your current position) would probably be kind of difficult (but perhaps possible). The pushing / popping you could do. You'd need to override the default mapping of to be some new Does that make sense at all? |
|
@DevonMorris do you mean setting the selection at the current position, because i have a change in #208 where you can set a |
|
@tjdevries yeah definitely makes sense. I'll see if I can get some time this weekend to try it out. @Conni2461 thanks, I'll check it out |
|
Implemented in #744 |
This PR adds a tagstack function. I marked it work in progress because we probably want a
make_entry.gen_from_tagstackand I want it to push/pop appropriately based on the selection.Also any other comments you have are appreciated.