tangled
alpha
login
or
join now
robinwobin.dev
/
artio.nvim
3
fork
atom
minimal extui fuzzy finder for neovim
3
fork
atom
overview
issues
pulls
pipelines
feat: allow custom prompt infolist
robinwobin.dev
1 week ago
72f0a13e
aecd8bb2
+23
-1
2 changed files
expand all
collapse all
unified
split
lua
artio
config.lua
view.lua
+2
lua/artio/config.lua
···
13
13
---@field prompt_title boolean
14
14
---@field pointer string
15
15
---@field marker string
16
16
+
---@field infolist ('index'|'list')[]
16
17
---@field use_icons boolean
17
18
18
19
---@class artio.config.win
···
34
35
prompt_title = true,
35
36
pointer = "",
36
37
marker = "│",
38
38
+
infolist = { "list" }, -- index: [1] list: (4/5)
37
39
use_icons = _G["MiniIcons"] and true or false,
38
40
},
39
41
win = {
+21
-1
lua/artio/view.lua
···
525
525
return result
526
526
end
527
527
528
528
+
---@param p artio.Picker
529
529
+
---@param info 'index'|'list'|string
530
530
+
---@return string
531
531
+
local function getpromptinfo(p, info)
532
532
+
if info == "index" then
533
533
+
return ("[%d]"):format(p.idx)
534
534
+
elseif info == "list" then
535
535
+
return ("(%d/%d)"):format(#p.matches, #p.items)
536
536
+
end
537
537
+
return ""
538
538
+
end
539
539
+
528
540
function View:drawprompt()
529
541
logdebug("drawprompt")
530
542
···
534
546
self:mark("promptinfo", promptidx, 0, {
535
547
virt_text = {
536
548
{
537
537
-
("[%d] (%d/%d)"):format(self.picker.idx, #self.picker.matches, #self.picker.items),
549
549
+
table.concat(
550
550
+
vim
551
551
+
.iter(self.picker.opts.infolist)
552
552
+
:map(function(info)
553
553
+
return getpromptinfo(self.picker, info)
554
554
+
end)
555
555
+
:totable(),
556
556
+
" "
557
557
+
),
538
558
"InfoText",
539
559
},
540
560
},