summaryrefslogtreecommitdiffstats
path: root/lua/conf/plugins/oil.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2025-05-18 22:32:28 -0400
committerSquibid <me@zacharyscheiman.com>2025-05-18 22:33:36 -0400
commitf9311db805dc29ed96b009c836231cd87b43b861 (patch)
tree1f84fe270ac110b0122ce1fb6ea39bc67c4957c2 /lua/conf/plugins/oil.lua
parentd0155fcc7c734c1e3506e59cbb17ec3fb2a4b541 (diff)
downloadnvim-f9311db805dc29ed96b009c836231cd87b43b861.tar.gz
nvim-f9311db805dc29ed96b009c836231cd87b43b861.tar.bz2
nvim-f9311db805dc29ed96b009c836231cd87b43b861.zip
try and make everything confined to 80chars
Diffstat (limited to 'lua/conf/plugins/oil.lua')
-rw-r--r--lua/conf/plugins/oil.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/lua/conf/plugins/oil.lua b/lua/conf/plugins/oil.lua
index d985105..62f452b 100644
--- a/lua/conf/plugins/oil.lua
+++ b/lua/conf/plugins/oil.lua
@@ -6,7 +6,8 @@ local function parse_output(proc)
local result = proc:wait()
local ret = {}
if result.code == 0 then
- for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
+ for line in vim.gsplit(result.stdout, "\n", {
+ plain = true, trimempty = true }) do
-- Remove trailing slash
line = line:gsub("/$", "")
ret[line] = true
@@ -20,16 +21,20 @@ local function new_git_status()
return setmetatable({}, {
__index = function(self, key)
local ignore_proc = vim.system(
- { "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
+ { "git", "ls-files", "--ignored", "--exclude-standard", "--others",
+ "--directory" },
+ {
+ cwd = key,
+ text = true,
+ }
+ )
+ local tracked_proc = vim.system({ "git", "ls-tree", "HEAD",
+ "--name-only" },
{
cwd = key,
text = true,
}
)
- local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
- cwd = key,
- text = true,
- })
local ret = {
ignored = parse_output(ignore_proc),
tracked = parse_output(tracked_proc),