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