minimal extui fuzzy finder for neovim

style: fmt

+26 -18
+5 -4
lua/artio/builtins.lua
··· 107 107 return vim.api.nvim_buf_get_lines(buf, row - 1, row, true)[1] 108 108 end, 109 109 preview_item = function(row) 110 - return buf, function(w) 111 - vim.api.nvim_set_option_value('cursorline', true, { scope = 'local', win = w }) 112 - vim.api.nvim_win_set_cursor(w, { row, 0 }) 113 - end 110 + return buf, 111 + function(w) 112 + vim.api.nvim_set_option_value("cursorline", true, { scope = "local", win = w }) 113 + vim.api.nvim_win_set_cursor(w, { row, 0 }) 114 + end 114 115 end, 115 116 get_icon = function(row) 116 117 local v = tostring(row.v)
+1 -1
lua/artio/config.lua
··· 41 41 width = vim.o.columns, 42 42 height = view.win.height, 43 43 col = 0, 44 - row = vim.o.lines - vim.o.cmdheight * 2 - 1 - (vim.o.winborder == 'none' and 0 or 2), 44 + row = vim.o.lines - vim.o.cmdheight * 2 - 1 - (vim.o.winborder == "none" and 0 or 2), 45 45 } 46 46 end, 47 47 },
+12 -9
lua/artio/init.lua
··· 92 92 ---@param on_choice fun(item: T|nil, idx: integer|nil) 93 93 ---@param start_opts? artio.Picker.proto 94 94 artio.select = function(items, opts, on_choice, start_opts) 95 - return artio.generic(items, vim.tbl_deep_extend("force", { 96 - prompt = opts.prompt, 97 - on_close = function(_, idx) 98 - return on_choice(items[idx], idx) 99 - end, 100 - format_item = opts.format_item and function(item) 101 - return opts.format_item(item) 102 - end or nil, 103 - }, start_opts or {})) 95 + return artio.generic( 96 + items, 97 + vim.tbl_deep_extend("force", { 98 + prompt = opts.prompt, 99 + on_close = function(_, idx) 100 + return on_choice(items[idx], idx) 101 + end, 102 + format_item = opts.format_item and function(item) 103 + return opts.format_item(item) 104 + end or nil, 105 + }, start_opts or {}) 106 + ) 104 107 end 105 108 106 109 ---@generic T
+8 -4
lua/artio/view.lua
··· 490 490 end 491 491 492 492 if not self.preview_win then 493 - self.preview_win = vim.api.nvim_open_win(buf, false, vim.tbl_extend("force", self.picker.win.preview_opts(self), { 494 - relative = "editor", 495 - style = "minimal", 496 - })) 493 + self.preview_win = vim.api.nvim_open_win( 494 + buf, 495 + false, 496 + vim.tbl_extend("force", self.picker.win.preview_opts(self), { 497 + relative = "editor", 498 + style = "minimal", 499 + }) 500 + ) 497 501 else 498 502 vim.api.nvim_win_set_buf(self.preview_win, buf) 499 503 end