Colour output for nvim ephemeral command

This commit is contained in:
Talia 2024-07-16 09:16:52 +02:00
parent 8a1596f8b3
commit d879ab677f

View file

@ -8,10 +8,12 @@ end, {})
vim.api.nvim_create_user_command("Ephemeral", function(params)
if params.args == "" then
print(vim.g.ephemeral_buffers
and "New buffers are ephemeral"
or "New buffers are permanent"
)
vim.api.nvim_echo({
{"New buffers are "},
vim.g.ephemeral_buffers
and {"ephemeral", "DiffDelete"}
or {"permanent", "DiffAdd"};
}, false, {})
elseif params.args == "on" then
vim.g.ephemeral_buffers = true
elseif params.args == "off" then