Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lua/showkeys/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ local update_win_w = function()
end

M.gen_winconfig()
api.nvim_win_set_config(state.win, state.config.winopts)
if state.win then
api.nvim_win_set_config(state.win, state.config.winopts)
end
end

M.draw = function()
Expand All @@ -81,9 +83,11 @@ end
M.clear_and_close = function()
state.keys = {}
M.redraw()
local tmp = state.win
state.win = nil
api.nvim_win_close(tmp, true)
if state.win then
local tmp = state.win
state.win = nil
api.nvim_win_close(tmp, true)
end
end

M.parse_key = function(char)
Expand Down