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

Add a method to show loclist #16

Closed
wants to merge 0 commits into from

Conversation

singalhimanshu
Copy link
Contributor

No description provided.

if next(locations) == nil then
locations = vim.fn.getloclist(0)
for _, value in pairs(locations) do
value.filename = vim.fn.bufname("%")
Copy link
Member

Choose a reason for hiding this comment

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

vim.api.nvim_buf_get_name(0) would be better

@@ -112,6 +112,13 @@ end

builtin.quickfix = function(opts)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add an opt for loclist_fallback?

Copy link
Member

Choose a reason for hiding this comment

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

Or.... hmm, maybe what we want is just two different functions.

Copy link
Member

Choose a reason for hiding this comment

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

They mean very different things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@singalhimanshu singalhimanshu changed the title Fix no quickfix items due to empty qflist Add a method to show loclist Sep 1, 2020
@singalhimanshu
Copy link
Contributor Author

I can add the info about this in README.md if you think the implementation is okay.

local locations = vim.fn.getloclist(0)

for _, value in pairs(locations) do
value.filename = vim.api.nvim_buf_get_name(0)
Copy link
Member

Choose a reason for hiding this comment

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

probably only need to get this once. Just for perf that doesn't matter.

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.

None yet

2 participants