From 03fb506bbd5fdbb2b21ac6b0fe38ed40e339b143 Mon Sep 17 00:00:00 2001 From: Damian Senn Date: Tue, 16 Jul 2024 22:06:13 +0200 Subject: [PATCH] feat: hide_context fn (#76) --- lua/nvim_context_vt/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/nvim_context_vt/init.lua b/lua/nvim_context_vt/init.lua index e95e637..0fcbe0f 100644 --- a/lua/nvim_context_vt/init.lua +++ b/lua/nvim_context_vt/init.lua @@ -51,7 +51,7 @@ end function M.toggle_context() if opts.enabled then opts.enabled = false - vim.api.nvim_buf_clear_namespace(0, ns, 0, -1) + M.hide_context() else opts.enabled = true M.show_context() @@ -83,4 +83,8 @@ function M.show_context() end end +function M.hide_context() + vim.api.nvim_buf_clear_namespace(0, ns, 0, -1) +end + return M