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
fix: `on_quit` hook select api
robinwobin.dev
6 days ago
b3f70af7
830e3518
+7
2 changed files
expand all
collapse all
unified
split
lua
artio
init.lua
picker.lua
+3
lua/artio/init.lua
···
134
134
on_close = function(_, idx)
135
135
return on_choice(items[idx], idx)
136
136
end,
137
137
+
on_quit = function()
138
138
+
return on_choice(nil, nil)
139
139
+
end,
137
140
},
138
141
opts or {}, -- opts.prompt, opts.format_item
139
142
start_opts or {}
+4
lua/artio/picker.lua
···
16
16
---@field preview_item? fun(item: any): integer, fun(win: integer)
17
17
---@field get_icon? fun(item: artio.Picker.item): string, string
18
18
---@field hl_item? fun(item: artio.Picker.item): artio.Picker.hl[]
19
19
+
---@field on_quit? fun()
19
20
---@field prompt? string
20
21
---@field defaulttext? string
21
22
---@field prompttext? string
···
88
89
self:close()
89
90
90
91
if result == action_enum.cancel or result ~= action_enum.accept then
92
92
+
if self.on_quit then
93
93
+
self.on_quit()
94
94
+
end
91
95
return
92
96
end
93
97