Skip to content
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

Jumplist picker uses quickfix entry maker. Delete jumplist entry maker. #973

Merged
merged 3 commits into from
Jul 11, 2021

Conversation

caojoshua
Copy link
Contributor

When I authored #839, I didn't include the jumplist text because we wouldn't be able to get text for closed buffers. This is a non-issue because I've found in my workflow that that recent entries on the jumplist are always open in a buffer. I think that having the buffer text feels a little better when going through the jumplist picker. For entries that aren't open in a buffer, we include empty text, but we expect it to not be surfaced to the user very often.

Another benefit is that the jumplist picker now reuses the quickfix entry maker, as many other pickers already do. This means we can delete the jumplist entry maker.

This is all opinionated. Open to ideas.

table.insert(sorted_jumplist, jumplist[i])
if vim.api.nvim_buf_is_valid(jumplist[i].bufnr) then
jumplist[i].text = vim.api.nvim_buf_get_lines(jumplist[i].bufnr, jumplist[i].lnum, jumplist[i].lnum+1,
false)[1] or ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this or just doesnt do anything. doesnt matter tho 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does something in my testing. If I bdelete a buffer, than the buffer is still valid, but we can't get the lines for it. Only when I bwipeout a buffer does a buffer become invalid. I'm not 100% on the behavior of buffers in vim and neovim, but I think bdelete keeps a lot of the buffer data around, but unloads the file text from memory.

Copy link
Member

@Conni2461 Conni2461 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks :)

@Conni2461 Conni2461 merged commit dc0dca2 into nvim-telescope:master Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants