Skip to content

Commit

Permalink
fix(sources-path): indexing nil value when previewing dirs/links, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Mar 3, 2024
1 parent 62ed697 commit 17d2fa8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/dropbar/sources/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ end

---@param self dropbar_symbol_t
local function preview_prepare_buf(self, path)
local buf
if vim.uv.fs_stat(path).type == 'directory' then
local stat = vim.uv.fs_stat(path)
if not stat or stat.type ~= 'file' then
self:preview_restore_view()
return
end
buf = vim.fn.bufnr(path, false)
local buf = vim.fn.bufnr(path, false)
if buf == nil or buf == -1 then
buf = vim.fn.bufadd(path)
if not buf then
Expand Down

0 comments on commit 17d2fa8

Please sign in to comment.