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