fix: loclist can have non current buf entries (#1333)
This commit is contained in:
@@ -338,10 +338,13 @@ end
|
|||||||
|
|
||||||
internal.loclist = function(opts)
|
internal.loclist = function(opts)
|
||||||
local locations = vim.fn.getloclist(0)
|
local locations = vim.fn.getloclist(0)
|
||||||
local filename = vim.api.nvim_buf_get_name(0)
|
local filenames = {}
|
||||||
|
|
||||||
for _, value in pairs(locations) do
|
for _, value in pairs(locations) do
|
||||||
value.filename = filename
|
local bufnr = value.bufnr
|
||||||
|
if filenames[bufnr] == nil then
|
||||||
|
filenames[bufnr] = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
end
|
||||||
|
value.filename = filenames[bufnr]
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.tbl_isempty(locations) then
|
if vim.tbl_isempty(locations) then
|
||||||
|
|||||||
Reference in New Issue
Block a user