Skip to content

Commit

Permalink
fix: don't use file sorter for items without a valid filename
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 31, 2021
1 parent aae12e7 commit 20469be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/trouble/providers/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function M.get(win, buf, cb, options)
function(item)
local cwd = vim.loop.fs_realpath(vim.fn.getcwd())
local path = vim.loop.fs_realpath(item.filename)
if not path then
return 200
end
local ret = string.find(path, cwd, 1, true) == 1 and 10 or 100
-- prefer non-hidden files
if string.find(path, ".") then
Expand Down

0 comments on commit 20469be

Please sign in to comment.