nvim-oxi icon indicating copy to clipboard operation
nvim-oxi copied to clipboard

Issue when trying to use the api example open_window() command.

Open MostHated opened this issue 1 year ago • 5 comments

Hey there, I am having issues with the API examples (api.open_window() command). I came across a testing script in another thread and gave it a try to see if it was just me that was doing something wrong or not. I ran the script and ended up with the same issue as my original plugin: E5108: Error executing lua Value of type () couldn't be pushed on the stack: "non-float cannot have \'row\'".. When I ran the tests that were included in ths repo (using nightly nvim), all the window ones passed, which threw me off a bit.

Doing some searching on the issue, it seems like it may have something to do with setting row/column and then having to set the window relative setting again after that? Unfortunately, I don't know enough about the nvim backend yet to try and do much more diagnostic, myself, outside of doing something silly:

I didn't expect much from this, but figured it might be worth a shot, lol.

let config = WindowConfig::builder()
     .relative(WindowRelativeTo::Editor)
     .width(10)
     .row(3)
     .col(3)
     .relative(WindowRelativeTo::Editor)
     .build();

Upon running the script, it looks like there might be another issue with the mlua example that I had not noticed, but wanted to still report it.

_ ✗  ./examples.sh
=== example: api ===
Hello from Rust
Error detected while processing command line:
E5108: Error executing lua Value of type () couldn\'t be pushed on the stack: "non-float cannot have \'row\'"
stack traceback:
        [C]: in function 'open_window'
        [string ":lua"]:7: in main chunk
hello
=== example: mlua ===
Hello from nvim-oxi..
..and goodbye from mlua!
Error detected while processing command line:
E5108: Error executing lua [string ":lua"]:1: attempt to index a boolean value
stack traceback:
        [string ":lua"]:1: in main chunk
=== example: calc ===
42
42
42
42
=== example: mechanic ===
Hands on the wheel!!

MostHated avatar Mar 04 '23 05:03 MostHated