Skip to content

Commit

Permalink
fix: create redraw function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramilito committed Dec 13, 2024
1 parent 57900e0 commit b0dc352
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/kubectl/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ function M.register()
desc = "Toggle headers",
callback = function()
config.options.headers = not config.options.headers
pcall(require("kubectl.views").Redraw)
end,
})

Expand Down
6 changes: 6 additions & 0 deletions lua/kubectl/views/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ function M.UserCmd(args)
end)
end

function M.Redraw()
local _, buf_name = pcall(vim.api.nvim_buf_get_var, 0, "buf_name")
local current_view, _ = M.view_and_definition(string.lower(vim.trim(buf_name)))
pcall(current_view.Draw)
end

--- Set a new URL and open the view
---@param opts table Options. Possible fields:
--- - <src> - Source view name where we are redirecting from
Expand Down

0 comments on commit b0dc352

Please sign in to comment.