···1616 if not findprg then
1717 return {}
1818 end
1919- local farg = string.format("'%s'", match)
1919+ local farg = string.format("'%s'", match or '')
2020 local findcmd, n = findprg:gsub("%$%*", farg)
2121 if n == 0 then
2222 findcmd = findcmd .. " " .. farg
···4141 return artio.pick({
4242 prompt = "files",
4343 fn = function(input)
4444- local lst = find_files(input)
4444+ local lst = find_files()
4545 if not lst or #lst == 0 then
4646 return {}
4747 end
+24-3
lua/artio/view.lua
···298298 promptidx = self.picker.opts.bottom and cmdline.erow or 0
299299end
300300301301+local view_ns = vim.api.nvim_create_namespace("artio:view:ns")
302302+---@type vim.api.keyset.set_extmark
303303+local ext_match_opts = {
304304+ hl_group = "ArtioMatch",
305305+ hl_mode = "combine",
306306+}
307307+301308function View:showitems()
302302- local prefix = (" "):rep(vim.fn.strdisplaywidth(self.picker.opts.pointer) + 1)
309309+ local indent = vim.fn.strdisplaywidth(self.picker.opts.pointer) + 1
310310+ local prefix = (" "):rep(indent)
303311304312 local lines = {} ---@type string[]
313313+ local hls = {}
305314 for i = 1, math.min(#self.picker.items, self.win.height - 1) do
306315 lines[#lines + 1] = ("%s%s"):format(prefix, self.picker.items[i][1])
316316+ hls[#hls + 1] = self.picker.items[i][2]
307317 end
308318 cmdline.erow = cmdline.srow + #lines
309319 vim.api.nvim_buf_set_lines(ext.bufs.cmd, cmdline.srow, cmdline.erow, false, lines)
320320+321321+ for i = 1, #hls do
322322+ for j = 1, #hls[i] do
323323+ local col = indent + hls[i][j]
324324+ vim.api.nvim_buf_set_extmark(
325325+ ext.bufs.cmd,
326326+ view_ns,
327327+ cmdline.srow + i - 1,
328328+ col,
329329+ vim.tbl_extend("force", ext_match_opts, { end_col = col+1 })
330330+ )
331331+ end
332332+ end
310333end
311311-312312-local view_ns = vim.api.nvim_create_namespace("artio:view:ns")
313334314335function View:hlselect()
315336 if self.select_ext then