Colour output for nvim ephemeral command

This commit is contained in:
Talia 2024-07-16 09:16:52 +02:00
parent 8a1596f8b3
commit d879ab677f
1 changed files with 6 additions and 4 deletions

View File

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