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: preview win logic
robinwobin.dev
3 months ago
37c0de65
117a633c
+14
-12
2 changed files
expand all
collapse all
unified
split
lua
artio
config.lua
view.lua
+1
-8
lua/artio/config.lua
···
39
39
win = {
40
40
height = 0.4,
41
41
hidestatusline = false, -- works best with laststatus=3
42
42
-
preview_opts = function(view)
43
43
-
return {
44
44
-
width = vim.o.columns,
45
45
-
height = view.win.height,
46
46
-
col = 0,
47
47
-
row = vim.o.lines - vim.o.cmdheight * 2 - 1 - (vim.o.winborder == "none" and 0 or 2),
48
48
-
}
49
49
-
end,
42
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
613
+
local previewopts = self.picker.win.preview_opts
614
614
+
and vim.is_callable(self.picker.win.preview_opts)
615
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
616
-
vim.tbl_extend("force", self.picker.win.preview_opts(self), {
619
619
+
vim.tbl_extend("force", {
617
620
relative = "editor",
618
618
-
style = "minimal",
619
619
-
})
621
621
+
width = vim.o.columns,
622
622
+
height = self.win.height,
623
623
+
col = 0,
624
624
+
row = vim.o.lines - vim.o.cmdheight * 2 - 1 - (vim.o.winborder == "none" and 0 or 2),
625
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
625
-
vim.api.nvim_set_option_value("previewwindow", true, { scope = "local", win = self.preview_win })
631
631
+
vim._with({ win = self.preview_win, noautocmd = true }, function()
632
632
+
vim.api.nvim_set_option_value("previewwindow", true, { scope = "local" })
633
633
+
vim.api.nvim_set_option_value("eventignorewin", "all,-FileType", { scope = "local" })
634
634
+
end)
626
635
627
636
if on_win and vim.is_callable(on_win) then
628
637
on_win(self.preview_win)