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
feat(builtins): colorscheme preview
robinwobin.dev
1 week ago
f4eeae90
0b7fd09b
+25
1 changed file
expand all
collapse all
unified
split
lua
artio
builtins.lua
+25
lua/artio/builtins.lua
···
416
return vim.fs.basename(f):gsub("%.[^.]+$", "")
417
end, files)
418
0
0
0
419
return artio.generic(
420
lst,
421
extend({
···
424
vim.schedule(function()
425
vim.cmd.colorscheme(text)
426
end)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
427
end,
428
}, props)
429
)
···
416
return vim.fs.basename(f):gsub("%.[^.]+$", "")
417
end, files)
418
419
+
local current = vim.g.colors_name
420
+
local bg = vim.o.background
421
+
422
return artio.generic(
423
lst,
424
extend({
···
427
vim.schedule(function()
428
vim.cmd.colorscheme(text)
429
end)
430
+
end,
431
+
on_quit = function()
432
+
-- reset colorscheme
433
+
vim.schedule(function()
434
+
if vim.g.colors_name ~= current then
435
+
vim.cmd.colorscheme(current)
436
+
end
437
+
end)
438
+
end,
439
+
preview_item = function(item)
440
+
return vim.api.nvim_create_buf(false, true),
441
+
function(w)
442
+
local buf = vim.api.nvim_win_get_buf(w)
443
+
vim.bo[buf].bufhidden = "wipe"
444
+
vim.bo[buf].buftype = "nofile"
445
+
446
+
vim.api.nvim_buf_set_lines(buf, 0, -1, false, {})
447
+
vim.api.nvim_win_set_config(w, { hide = true })
448
+
449
+
vim.cmd.colorscheme(item)
450
+
vim.o.background = bg
451
+
end
452
end,
453
}, props)
454
)