minimal extui fuzzy finder for neovim

fix: preview win logic

+14 -12
+1 -8
lua/artio/config.lua
··· 39 39 win = { 40 40 height = 0.4, 41 41 hidestatusline = false, -- works best with laststatus=3 42 - preview_opts = function(view) 43 - return { 44 - width = vim.o.columns, 45 - height = view.win.height, 46 - col = 0, 47 - row = vim.o.lines - vim.o.cmdheight * 2 - 1 - (vim.o.winborder == "none" and 0 or 2), 48 - } 49 - end, 42 + preview_opts = nil, 50 43 }, 51 44 mappings = { 52 45 ["<down>"] = "down",
+13 -4
lua/artio/view.lua
··· 610 610 end 611 611 612 612 if not self.preview_win then 613 + local previewopts = self.picker.win.preview_opts 614 + and vim.is_callable(self.picker.win.preview_opts) 615 + and self.picker.win.preview_opts(self) 613 616 self.preview_win = vim.api.nvim_open_win( 614 617 buf, 615 618 false, 616 - vim.tbl_extend("force", self.picker.win.preview_opts(self), { 619 + vim.tbl_extend("force", { 617 620 relative = "editor", 618 - style = "minimal", 619 - }) 621 + width = vim.o.columns, 622 + height = self.win.height, 623 + col = 0, 624 + row = vim.o.lines - vim.o.cmdheight * 2 - 1 - (vim.o.winborder == "none" and 0 or 2), 625 + }, previewopts or {}) 620 626 ) 621 627 else 622 628 vim.api.nvim_win_set_buf(self.preview_win, buf) 623 629 end 624 630 625 - vim.api.nvim_set_option_value("previewwindow", true, { scope = "local", win = self.preview_win }) 631 + vim._with({ win = self.preview_win, noautocmd = true }, function() 632 + vim.api.nvim_set_option_value("previewwindow", true, { scope = "local" }) 633 + vim.api.nvim_set_option_value("eventignorewin", "all,-FileType", { scope = "local" }) 634 + end) 626 635 627 636 if on_win and vim.is_callable(on_win) then 628 637 on_win(self.preview_win)