Skip to content

Commit

Permalink
fix(telescope): properly fix issue with relative filenames in telesco…
Browse files Browse the repository at this point in the history
…pe. See #250
  • Loading branch information
folke committed Feb 10, 2023
1 parent fc00342 commit 7da0821
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/trouble/providers/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ local function item_to_result(item)
local col = (item.col or 1) - 1

if not item.bufnr then
item.bufnr = vim.fn.bufnr((item.cwd or ".") .. "/" .. item.filename, true)
local fname = vim.fn.fnamemodify(item.filename, ":p")
if vim.fn.filereadable(fname) == 0 and item.cwd then
fname = vim.fn.fnamemodify(item.cwd .. "/" .. item.filename, ":p")
end
item.bufnr = vim.fn.bufnr(fname, true)
end

local pitem = {
Expand Down

0 comments on commit 7da0821

Please sign in to comment.