fix: small improvements
This commit is contained in:
+10
-5
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user