|
I'm quite new to nvim so bear with me. I have a minimal setup with Auto-session and ShowKeys and as soon as Auto-session is enabled I don't see the output from ShowKeys. Showkeys is not as vital as Auto-session but it is quite nice for when I'm video chatting with a friend also just getting into nvim. If anyone has encountered the same and managed to fix it, please chime in. Here's my config for the two plugins: Thanks! |
Replies: 1 comment 2 replies
|
I added your showkeys config to my setup and it seems to work as expected except when i do the following:
Interestingly, if i run Error executing Lua callback: vim/_editor.lua:0: nvim_exec2(), line 1: Vim(bdelete):E516: No buffers were deleted: bd 13
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...am/.local/share/nvim/lazy/showkeys/lua/showkeys/init.lua:74: in function <...am/.local/share/nvim/lazy/showkeys/lua/showkeys/init.lua:68>
...am/.local/share/nvim/lazy/showkeys/lua/showkeys/init.lua:81: in function 'toggle'
.../cam/.local/share/nvim/lazy/showkeys/plugin/showkeys.lua:2: in function <.../cam/.local/share/nvim/lazy/showkeys/plugin/showkeys.lua:1>When we switch sessions, we blow away all existing buffers and I suspect that includes the buffer for showkeys. The function generating the error is: M.close = function()
api.nvim_del_augroup_by_name "ShowkeysAu"
state.timer:stop()
state.keys = {}
state.w = 1
state.extmark_id = nil
vim.cmd("bd" .. state.buf)
vim.on_key(nil, state.on_key)
state.visible = false
state.win = nil
endstate.buf must no longer be pointing to a valid buffer so vim.cmd("silent! bd" .. state.buf)This still causes showkeys to stop displaying when a second session is restored but at least it can be turned back on. To have it continue functioning after a second session is restored, either showkeys would need to be updated to handle it's buffer going on (it creates a state buffer on init.lua:15) or you can add an autosession hook that checks if post_restore_cmds = {
function()
-- this will trigger loading of showkeys if it hadn't already been loaded, if you really don't want that
-- you can check require('lazy.core.config').plugins['showkeys']._.loaded first
if require('showkeys.state').visible then require('showkeys').open() end
end,
},I'll open a issue / pr on showkeys for my change above. |
I added your showkeys config to my setup and it seems to work as expected except when i do the following:
:ShowkeysToggleand verify that keys are shownInterestingly, if i run
:ShowkeysToggleagain, i get this error