-
-
Notifications
You must be signed in to change notification settings - Fork 856
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 and jump to row/col on existing buffers. #813
Conversation
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.
I love this! You've done a great job for this being your first experience writing lua for a neovim plugin 😄. Thanks for the contribution and for taking an interest! I've left a few comments of minor suggestions and clarifications, but this looks pretty nice to me. I'm a pretty new maintainer here and am still learning the codebase myself, so I'll wait for feedback from one of the other maintainers before considering merging this.
You mentioned that getjumplist()
doesn't include the file text, can you describe why this is an issue for what you built here? I noticed you can see the location in the jumplist in the preview window, what did you have in mind to implement if you were able to get access to the file text?
Thanks for the review! Let me clarify. For example, quickfix list does:
Where Instead, I've implemented
I would prefer it to also include the text, but there does not seem to be an easy way to do it. Otherwise, I'll implement the suggestions I'm not responding to. |
Oh I see! Unfortunately I don't know of any other vimscript functions that might make that possible. I'm relatively new to Lua and Neovim plugin development myself, so I'm still learning the APIs. With the new changes this LGTM, as I mentioned before I'll wait for another maintainer to give this the green light before merging. |
@caojoshua thanks for all the hard work on this! I'll merge this once #821 is resolved (that is what is causing the two tests to fail atm) |
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.
LGTM.
Can we get a mention of that picker in the README?
Thanks everyone. Left another commit for adding things to README |
end | ||
|
||
return function(entry) | ||
local filename = entry.filename or vim.api.nvim_buf_get_name(entry.bufnr) |
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.
Just tested it. I am getting: Invalid buffer id: 1
here if i had startify open before.
So: nvim
-> :Telescope find_files
-> open file
-> :Telescope jumplist
(error)
If i do: nvim file
-> :Telescope jumplist
works great
We should do
if not vim.api.nvim_buf_is_valid(entry.bufnr) then
return
end
before this line. 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.
Otherwise works great :) thanks
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.
Added this to the commit.
I personally don't use startify, and haven't been able to reproduce a scenario where this makes/breaks anything. I think its OK, unless there is some other sort of verification we can do.
Thanks all the work. Let's get this merged :) |
First time developer for lua, neovim plugin, and open source. Please help me in this learning experience.
Partially address #715
jumplist
pickerThe major limitation right now is that vim
getjumplist()
does not include file text.vim.api.nvim_buf_get_lines()
does not work because some jump targets are in unloaded buffers. I decided to only include the filename and row/col in the entries, and rely on the previewer to view contents. Open to any suggestions here.