NStefan002 / screenkey.nvim

Screencast your keys in Neovim
MIT License
291 stars 5 forks source link

Error executing vim.on_key Lua callback: vim/_editor.lua:0: Error executing 'on_key' with ns_ids '28' #4

Closed Zeddnyx closed 4 months ago

Zeddnyx commented 4 months ago

Error executing vim.on_key Lua callback: vim/_editor.lua:0: Error executing 'on_key' with ns_ids '28' Messages: ...al/share/nvim/lazy/screenkey.nvim/lua/screenkey/init.lua:268: attempt to get length of local 'typed' (a nil value) stack traceback: [C]: in function 'error' vim/_editor.lua: in function <vim/_editor.lua:0>

i got that error after type something in keyboard i just install by followed the Lazy error-nvim

os: Arch terminal: Kitty

thohnb commented 4 months ago

Hey. We are in the same boat. Mine is 56.

wvffle commented 4 months ago

Here is mine:

image

Installed through nixvim as:

    extraPlugins = with pkgs.vimPlugins; [
      (pkgs.vimUtils.buildVimPlugin {
        name = "screenkey";
        src = pkgs.fetchFromGitHub {
          owner = "NStefan002";
          repo = "screenkey.nvim";
          rev = "51bb931c7679d8dc8482b449b3a970bfd4d43382";
          hash = "sha256-gcZ7hbWXeDxKmYuDnCjuq3mH3EN5l+ZBwitm17dR2Jc=";
        };
      })
    ];
NStefan002 commented 4 months ago

@Zeddnyx, @thohnb, @wvffle thanks for reporting this. I couldn't find a consistent way to reproduce this, but it should be fixed now. Do you mind testing it (1.2.1)?

Zeddnyx commented 4 months ago

Sure, I'll try

wvffle commented 4 months ago

@NStefan002 thanks for quick reaction! The error does not show up anymore for me but the window does not show any keys being pressed also.

NStefan002 commented 4 months ago

... but the window does not show any keys being pressed also.

@wvffle I don't experience this, do you mind sharing more info?

wvffle commented 4 months ago

do you mind sharing more info?

No matter the mode or the action I do, the Screenkey window stays blank. This may be due to some plugin messing around, as I have a pretty big config. I don't quite have the time to debug this right now, unfortunately.

image

According to: https://neovim.io/doc/user/lua.html#vim.on_key()

{typed} is the key(s) before mappings are applied, which may be empty if {key} is produced by non-typed keys.

So I guess, that @Zeddnyx and @thohnb would also have such issue, as the typed value was nil for them too. Maybe, if the typed is null, you could use key as a fallback?

Zeddnyx commented 4 months ago

do you mind sharing more info?

No matter the mode or the action I do, the Screenkey window stays blank. This may be due to some plugin messing around, as I have a pretty big config. I don't quite have the time to debug this right now, unfortunately.

image

According to: https://neovim.io/doc/user/lua.html#vim.on_key()

{typed} is the key(s) before mappings are applied, which may be empty if {key} is produced by non-typed keys.

So I guess, that @Zeddnyx and @thohnb would also have such issue, as the typed value was nil for them too. Maybe, if the typed is null, you could use key as a fallback?

yeah i have same issue like that

NStefan002 commented 4 months ago

I hope it's fixed now. I'm sorry for prolonging this, but I can't test this (I don't get this bug on any machine available to me, or on any terminal I tried). To test this use the following lazy-spec:

{
    "NStefan002/screenkey.nvim",
    cmd = "Screenkey",
    opts = {},
}

Also, please update your nightly version to latest, the new on_key was introduce very recently.

thohnb commented 4 months ago

Sorry. I was busy recent. After tried. IT work now. ảnh

Zeddnyx commented 4 months ago

it work for me to, thanks :)

NStefan002 commented 4 months ago

Thank you guys!