Skip to content

Commit

Permalink
fix(telescope): correctly use cwd for files. Fixes #250
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 19, 2023
1 parent 83ec606 commit 3174767
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/trouble/providers/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local function item_to_result(item)
local col = (item.col or 1) - 1

if not item.bufnr then
item.bufnr = vim.fn.bufnr(item.filename, true)
item.bufnr = vim.fn.bufnr((item.cwd or ".") .. "/" .. item.filename, true)
end

local pitem = {
Expand Down Expand Up @@ -72,7 +72,9 @@ end

function M.telescope(_win, _buf, cb, _options)
if #M.results == 0 then
util.warn("No Telescope results found. Open Telescopen and send results to Trouble first. Refer to the documentation for more info.")
util.warn(
"No Telescope results found. Open Telescopen and send results to Trouble first. Refer to the documentation for more info."
)
end
cb(M.results)
end
Expand Down

0 comments on commit 3174767

Please sign in to comment.