From 547db6e9297ca9b0da95965d1760461b33b44687 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 19 Dec 2022 15:11:12 +1100 Subject: [PATCH] fix(#1831): remove error messages that were previously unreachable and add no value --- lua/nvim-tree/explorer/explore.lua | 12 +----------- lua/nvim-tree/explorer/reload.lua | 6 ++---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/lua/nvim-tree/explorer/explore.lua b/lua/nvim-tree/explorer/explore.lua index 472e169c..0ea6addf 100644 --- a/lua/nvim-tree/explorer/explore.lua +++ b/lua/nvim-tree/explorer/explore.lua @@ -4,7 +4,6 @@ local explorer_node = require "nvim-tree.explorer.node" local sorters = require "nvim-tree.explorer.sorters" local filters = require "nvim-tree.explorer.filters" local live_filter = require "nvim-tree.live-filter" -local notify = require "nvim-tree.notify" local log = require "nvim-tree.log" local M = {} @@ -46,18 +45,9 @@ local function populate_children(handle, cwd, node, git_status) end end -local function get_dir_handle(cwd) - local handle, err = utils.fs_scandir_profiled(cwd) - if err then - notify.error(string.format("Failed exploring %s: %s", cwd, vim.inspect(err))) - return - end - return handle -end - function M.explore(node, status) local cwd = node.link_to or node.absolute_path - local handle = get_dir_handle(cwd) + local handle = utils.fs_scandir_profiled(cwd) if not handle then return end diff --git a/lua/nvim-tree/explorer/reload.lua b/lua/nvim-tree/explorer/reload.lua index d5b992fe..2247a3a4 100644 --- a/lua/nvim-tree/explorer/reload.lua +++ b/lua/nvim-tree/explorer/reload.lua @@ -4,7 +4,6 @@ local explorer_node = require "nvim-tree.explorer.node" local filters = require "nvim-tree.explorer.filters" local sorters = require "nvim-tree.explorer.sorters" local live_filter = require "nvim-tree.live-filter" -local notify = require "nvim-tree.notify" local git = require "nvim-tree.git" local log = require "nvim-tree.log" @@ -36,9 +35,8 @@ end function M.reload(node, git_status, unloaded_bufnr) local cwd = node.link_to or node.absolute_path - local handle, err = utils.fs_scandir_profiled(cwd) - if err then - notify.error(string.format("Failed reloading %s: %s", cwd, vim.inspect(err))) + local handle = utils.fs_scandir_profiled(cwd) + if not handle then return end