feature: add conflict git status to picker
Did you check the docs?
- [X] I have read all the snacks.nvim docs
Is your feature request related to a problem? Please describe.
Reading through picker documentation, I saw that conflict git status icon is missing.
In Neotree I could have had files with conflicts marked with an icon and a highlight.
Describe the solution you'd like
Add a conflict git status icon and highlight
Describe alternatives you've considered
none
Additional context
No response
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Bad bot.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Bad bot.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Very bad bot.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Extremely bad bot.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
bad bot.
This could be added as an explicit alias (I leave this up to @folke), but it's quite easy to filter the items from the git_status picker with the transform picker option.
The items already have a nice item.status member with the status string, it's as simple as filtering for items with conflict status codes. I wrote this snippet that works great for my needs, although there may be cleaner solutions:
-- poor man's set
local confilct_codes = { ["UU"] = 1, ["AA"] = 1, ["DD"] = 1, ["AU"] = 1, ["UA"] = 1, ["UD"] = 1, ["DU"] = 1 }
vim.keymap.set("n", "<leader>gc", function()
snacks.picker.pick({
-- not using the git_status picker directly because I don't want the tab-to-stage keymap
finder = "git_status",
format = "git_status",
preview = "git_status",
transform = function(item)
return confilct_codes[item.status] == 1
end,
})
end, { desc = "pick [g]it [c]onflicts" })
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
bad bot!