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
---@field prompt_title boolean
14
---@field pointer string
15
---@field marker string
0
16
---@field use_icons boolean
17
18
---@class artio.config.win
···
34
prompt_title = true,
35
pointer = "",
36
marker = "│",
0
37
use_icons = _G["MiniIcons"] and true or false,
38
},
39
win = {
···
13
---@field prompt_title boolean
14
---@field pointer string
15
---@field marker string
16
+
---@field infolist ('index'|'list')[]
17
---@field use_icons boolean
18
19
---@class artio.config.win
···
35
prompt_title = true,
36
pointer = "",
37
marker = "│",
38
+
infolist = { "list" }, -- index: [1] list: (4/5)
39
use_icons = _G["MiniIcons"] and true or false,
40
},
41
win = {
+21
-1
lua/artio/view.lua
···
525
return result
526
end
527
0
0
0
0
0
0
0
0
0
0
0
0
528
function View:drawprompt()
529
logdebug("drawprompt")
530
···
534
self:mark("promptinfo", promptidx, 0, {
535
virt_text = {
536
{
537
-
("[%d] (%d/%d)"):format(self.picker.idx, #self.picker.matches, #self.picker.items),
0
0
0
0
0
0
0
0
538
"InfoText",
539
},
540
},
···
525
return result
526
end
527
528
+
---@param p artio.Picker
529
+
---@param info 'index'|'list'|string
530
+
---@return string
531
+
local function getpromptinfo(p, info)
532
+
if info == "index" then
533
+
return ("[%d]"):format(p.idx)
534
+
elseif info == "list" then
535
+
return ("(%d/%d)"):format(#p.matches, #p.items)
536
+
end
537
+
return ""
538
+
end
539
+
540
function View:drawprompt()
541
logdebug("drawprompt")
542
···
546
self:mark("promptinfo", promptidx, 0, {
547
virt_text = {
548
{
549
+
table.concat(
550
+
vim
551
+
.iter(self.picker.opts.infolist)
552
+
:map(function(info)
553
+
return getpromptinfo(self.picker, info)
554
+
end)
555
+
:totable(),
556
+
" "
557
+
),
558
"InfoText",
559
},
560
},