fix: small improvements

This commit is contained in:
2026-09-11 21:08:01 +02:00
parent 8292ff741d
commit b9c53bc8e7
5 changed files with 48 additions and 27 deletions
+10 -5
View File
@@ -14,12 +14,17 @@ end
return {
status = function()
local items = {}
for _, l in ipairs(vim.fn.systemlist('git status -s -u')) do
local p = l:sub(4):gsub('.* %-> ', '')
if vim.uv.fs_stat(p) then items[#items + 1] = { text = l, path = p } end
local lines = vim.fn.systemlist('git status -s -u')
if vim.v.shell_error ~= 0 then
return vim.notify('Not a git repository', vim.log.levels.WARN)
end
if #items == 0 then return vim.notify('No changes') end
local items = {}
for _, l in ipairs(lines) do
local p = l:sub(4):gsub('.* %-> ', ''):gsub('^"(.*)"$', '%1')
items[#items + 1] = { text = l, path = p }
end
if #items == 0 then return vim.notify('No changes', vim.log.levels.INFO) end
MiniPick.start({
source = { items = items, name = 'Git Status', show = show },