diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 15e229b667a..51beee21a38 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -10,7 +10,7 @@ local legacy = require "nvim-tree.legacy" local core = require "nvim-tree.core" local git = require "nvim-tree.git" local filters = require "nvim-tree.explorer.filters" -local modified = require "nvim-tree.modified" +local buffers = require "nvim-tree.buffers" local events = require "nvim-tree.events" local notify = require "nvim-tree.notify" @@ -313,7 +313,7 @@ local function setup_autocommands(opts) create_nvim_tree_autocmd({ "BufModifiedSet", "BufWritePost" }, { callback = function() utils.debounce("Buf:modified", opts.view.debounce_delay, function() - modified.reload() + buffers.reload_modified() actions.reloaders.reload_explorer() end) end, diff --git a/lua/nvim-tree/modified.lua b/lua/nvim-tree/modified.lua deleted file mode 100644 index e16c0750e7e..00000000000 --- a/lua/nvim-tree/modified.lua +++ /dev/null @@ -1,41 +0,0 @@ -local M = {} - ----@type table record of which file is modified -M._record = {} - ----refresh M.record -function M.reload() - M._record = {} - local bufs = vim.fn.getbufinfo { bufmodified = true, buflisted = true } - for _, buf in pairs(bufs) do - local path = buf.name - if path ~= "" then -- not a [No Name] buffer - -- mark all the parent as modified as well - while - M._record[path] ~= true - -- no need to keep going if already recorded - -- This also prevents an infinite loop - do - M._record[path] = true - path = vim.fn.fnamemodify(path, ":h") - end - end - end -end - ----@param node Node ----@return boolean -function M.is_modified(node) - return node - and M.config.enable - and M._record[node.absolute_path] - and (not node.nodes or M.config.show_on_dirs) - and (not node.open or M.config.show_on_open_dirs) -end - ----@param opts table -function M.setup(opts) - M.config = opts.modified -end - -return M diff --git a/lua/nvim-tree/renderer/builder.lua b/lua/nvim-tree/renderer/builder.lua index fd2771c0712..7cb6fe7ec71 100644 --- a/lua/nvim-tree/renderer/builder.lua +++ b/lua/nvim-tree/renderer/builder.lua @@ -4,7 +4,6 @@ local live_filter = require "nvim-tree.live-filter" local notify = require "nvim-tree.notify" local utils = require "nvim-tree.utils" local view = require "nvim-tree.view" -local log = require "nvim-tree.log" local DecoratorBookmarks = require "nvim-tree.renderer.decorator.bookmarks" local DecoratorCopied = require "nvim-tree.renderer.decorator.copied" @@ -230,7 +229,6 @@ function Builder:format_line(indent_markers, arrows, icon, name, node) add_to_end(line, M.decorators[i]:icons_after(node)) end - log.line("dev", "line = %s", vim.inspect(line)) return line end