snacks + tabline changes

This commit is contained in:
iofq 2025-07-18 09:36:11 -05:00
parent 97d6553252
commit ac39b0585d
No known key found for this signature in database
GPG key ID: ECF3B2DA38BF7183
11 changed files with 120 additions and 70 deletions

View file

@ -1,10 +1,10 @@
M = {}
M.marks = function()
return {
finder = 'vim_marks',
format = 'file',
Snacks.picker.marks {
['local'] = false,
global = true,
on_show = function()
vim.cmd.delmarks { args = { '0-9' } }
end,
actions = {
markdel = function(picker)
for _, item in ipairs(picker:selected()) do
@ -17,10 +17,42 @@ M.marks = function()
end,
},
win = {
list = {
keys = { ['dd'] = 'markdel' },
input = {
keys = { ['<c-x>'] = 'markdel' },
},
},
}
end
M.diagnostics = function(filter)
Snacks.picker.diagnostics {
filter = filter,
focus = 'list',
format = function(item, picker)
P = require('snacks.picker.format')
local ret = {} ---@type snacks.picker.Highlight[]
vim.list_extend(ret, P.filename(item, picker))
local diag = item.item ---@type vim.Diagnostic
if item.severity then
vim.list_extend(ret, P.severity(item, picker))
end
local message = diag.message
ret[#ret + 1] = { message }
Snacks.picker.highlight.markdown(ret)
ret[#ret + 1] = { ' ' }
if diag.source then
ret[#ret + 1] = { diag.source, 'SnacksPickerDiagnosticSource' }
ret[#ret + 1] = { ' ' }
end
if diag.code then
ret[#ret + 1] = { ('(%s)'):format(diag.code), 'SnacksPickerDiagnosticCode' }
ret[#ret + 1] = { ' ' }
end
return ret
end,
}
end
return M