summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-01-02 10:34:19 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-01-02 10:34:19 +0900
commit67ba5426d8d74e35c948108acc54946a1908406d (patch)
tree84d5321d012080c8ed99c9f289997bf918cebbde
parentdaa5c24fceec0a20f83185b9049517b0410904b7 (diff)
modified plugins/mini.lua, modified plugins/mini.lua, modified plugins/mini.luaHEADmaster
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua48
-rw-r--r--debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua48
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua18
3 files changed, 57 insertions, 57 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
index 993b02c..848bf09 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
@@ -796,21 +796,21 @@ end tell
---@return string symbol, string hlGroup
local function mapSymbols(status, is_symlink)
local statusMap = {
--- stylua: ignore start
-[" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory
-["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index
-["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index
-["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file
-["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index
-["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area
-["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index
-["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory
-["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index
-["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path
-["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged
-["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree
-["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files
-["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files
+ -- stylua: ignore start
+ [" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory
+ ["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index
+ ["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index
+ ["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file
+ ["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index
+ ["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area
+ ["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index
+ ["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory
+ ["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index
+ ["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path
+ ["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged
+ ["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree
+ ["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files
+ ["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files
-- stylua: ignore end
}
@@ -927,18 +927,18 @@ end tell
---@param buf_id integer
---@return nil
local function updateGitStatus(buf_id)
- local cwd = vim.uv.cwd()
- if not cwd or not vim.fs.root(cwd, ".git") then
+ local git_root = vim.fs.root(buf_id, ".git")
+ if not git_root then
return
end
local currentTime = os.time()
- if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then
- updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap)
+ if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then
+ updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap)
else
- fetchGitStatus(cwd, function(content)
+ fetchGitStatus(git_root, function(content)
local gitStatusMap = parseGitStatus(content)
- gitStatusCache[cwd] = {
+ gitStatusCache[git_root] = {
time = currentTime,
statusMap = gitStatusMap,
}
@@ -979,9 +979,9 @@ end tell
pattern = "MiniFilesBufferUpdate",
callback = function(sii)
local bufnr = sii.data.buf_id
- local cwd = vim.fn.expand("%:p:h")
- if gitStatusCache[cwd] then
- updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap)
+ local git_root = vim.fs.root(bufnr, ".git")
+ if git_root and gitStatusCache[git_root] then
+ updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap)
end
end,
})
diff --git a/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
index 993b02c..848bf09 100644
--- a/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
+++ b/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
@@ -796,21 +796,21 @@ end tell
---@return string symbol, string hlGroup
local function mapSymbols(status, is_symlink)
local statusMap = {
--- stylua: ignore start
-[" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory
-["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index
-["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index
-["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file
-["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index
-["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area
-["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index
-["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory
-["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index
-["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path
-["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged
-["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree
-["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files
-["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files
+ -- stylua: ignore start
+ [" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory
+ ["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index
+ ["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index
+ ["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file
+ ["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index
+ ["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area
+ ["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index
+ ["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory
+ ["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index
+ ["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path
+ ["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged
+ ["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree
+ ["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files
+ ["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files
-- stylua: ignore end
}
@@ -927,18 +927,18 @@ end tell
---@param buf_id integer
---@return nil
local function updateGitStatus(buf_id)
- local cwd = vim.uv.cwd()
- if not cwd or not vim.fs.root(cwd, ".git") then
+ local git_root = vim.fs.root(buf_id, ".git")
+ if not git_root then
return
end
local currentTime = os.time()
- if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then
- updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap)
+ if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then
+ updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap)
else
- fetchGitStatus(cwd, function(content)
+ fetchGitStatus(git_root, function(content)
local gitStatusMap = parseGitStatus(content)
- gitStatusCache[cwd] = {
+ gitStatusCache[git_root] = {
time = currentTime,
statusMap = gitStatusMap,
}
@@ -979,9 +979,9 @@ end tell
pattern = "MiniFilesBufferUpdate",
callback = function(sii)
local bufnr = sii.data.buf_id
- local cwd = vim.fn.expand("%:p:h")
- if gitStatusCache[cwd] then
- updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap)
+ local git_root = vim.fs.root(bufnr, ".git")
+ if git_root and gitStatusCache[git_root] then
+ updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap)
end
end,
})
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
index be4daa4..a9e39c2 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
@@ -927,18 +927,18 @@ return {
---@param buf_id integer
---@return nil
local function updateGitStatus(buf_id)
- local cwd = vim.uv.cwd()
- if not cwd or not vim.fs.root(cwd, ".git") then
+ local git_root = vim.fs.root(buf_id, ".git")
+ if not git_root then
return
end
local currentTime = os.time()
- if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then
- updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap)
+ if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then
+ updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap)
else
- fetchGitStatus(cwd, function(content)
+ fetchGitStatus(git_root, function(content)
local gitStatusMap = parseGitStatus(content)
- gitStatusCache[cwd] = {
+ gitStatusCache[git_root] = {
time = currentTime,
statusMap = gitStatusMap,
}
@@ -979,9 +979,9 @@ return {
pattern = "MiniFilesBufferUpdate",
callback = function(sii)
local bufnr = sii.data.buf_id
- local cwd = vim.fn.expand("%:p:h")
- if gitStatusCache[cwd] then
- updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap)
+ local git_root = vim.fs.root(bufnr, ".git")
+ if git_root and gitStatusCache[git_root] then
+ updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap)
end
end,
})