AutoYADM commit: 2024-12-18 16:55:04

This commit is contained in:
Daniel Fichtinger 2024-12-18 16:55:04 -05:00
parent fcbaa006de
commit 50ceb16452
2 changed files with 21 additions and 6 deletions

View file

@ -37,13 +37,25 @@ local new_git_status = function()
}) })
end end
M.git_status = new_git_status() local git_status = new_git_status()
local refresh = require("oil.actions").refresh M.handle_git = function(name, bufnr)
local orig_refresh = refresh.callback local refresh = require("oil.actions").refresh
refresh.callback = function(...) local orig_refresh = refresh.callback
M.git_status = new_git_status() refresh.callback = function(...)
orig_refresh(...) git_status = new_git_status()
orig_refresh(...)
end
local dir = require("oil").get_current_dir(bufnr)
local is_dotfile = vim.startswith(name, ".") and name ~= ".."
if not dir then
return is_dotfile
end
if is_dotfile then
return not git_status[dir].tracked[name]
else
return git_status[dir].ignored[name]
end
end end
return M return M

View file

@ -32,6 +32,9 @@ return {
-- There's a recipe for this in the docs -- There's a recipe for this in the docs
-- "permissions", -- "permissions",
}, },
view_options = {
is_hidden_file = require("oil-extras").handle_git,
},
keymaps = { keymaps = {
["<BS>"] = "actions.parent", ["<BS>"] = "actions.parent",
["gd"] = { ["gd"] = {