Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:messages crashes neovide, and doesn't seem to do anything in terminal? #10

Closed
znd4 opened this issue Oct 3, 2022 · 12 comments
Closed

Comments

@znd4
Copy link

znd4 commented Oct 3, 2022

Hi, first of all, I LOVE what I've been able to play around with so far (the command prompt).

However, whenever I call messages in neovide (my IDE of choice), I get a crash. Also, when calling :messages from nvim in kitty, nothing happens

neovide

When running neovide from the terminal to check the stderr

neovide --nofork

I get

ERROR [neovide::error_handling] Could not parse event from neovim: invalid array format false
thread 'tokio-runtime-worker' panicked at 'Could not parse event from neovim: invalid array format false', src/error_handling.rs:5:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR [neovide::bridge] Error joining IO loop: 'task 11 panicked'

I'm guessing neovide might not be accepting something that it should? Although I'm not even sure how to write an issue for them, because I don't know enough about nvim's internals / where they're expecting an array but should also accept a boolean

just nvim

running :messages in nvim in kitty, nothing happens.

I'm not sure of the best way to investigate this particular issue further -- ~/.cache/nvim/log doesn't have any new logs :/

Is there something I could do to try to get more verbose logs? (including somewhere in this repo's source I should try to debug (likely by dropping in print statements, b.c. I haven't tried setting up debuggers in neovim yet, and I don't even know if there's a lua debugger)

@folke
Copy link
Owner

folke commented Oct 3, 2022

for nvim: it will only show something if there are effectively any messages present.
Can you test again with the latest version? Somehow my error handler stopped working due to a bug.

@folke
Copy link
Owner

folke commented Oct 3, 2022

You can also enable debug mode, to get stack traces {debug=true}

@folke
Copy link
Owner

folke commented Oct 3, 2022

Just tested on Neovide and I get this error for :messages

ERROR [neovide::error_handling] Could not parse event from neovim: invalid string format []
thread 'tokio-runtime-worker' panicked at 'Could not parse event from neovim: invalid string format []', src/error_handling.rs:5:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR [neovide::bridge] Error joining IO loop: 'task 9 panicked'

@znd4
Copy link
Author

znd4 commented Oct 3, 2022

Thanks :D

After updating the plugin, I'm now getting the same neovide error as you (invalid string format [])

However, :messages is working in nvim now!

@folke
Copy link
Owner

folke commented Oct 3, 2022

I just checked the Neovide code and I think I know what's happening.

Both Noice and Neovide use the ui externalisation API.

In Noice I subscribe to ext_messages which also includes msg_history_show. That's an event specifically for :messages.

The Neovide error is triggered here https://github.com/neovide/neovide/blob/361c1d89f7afbb7d5e5c4a44f3f9c5a3ed3b3c16/src/bridge/handler.rs#L72

There's no handler for msg_history_show here https://github.com/neovide/neovide/blob/38229f813297e54d04e34cee339f4af217462662/src/bridge/events.rs#L844

There shouldn't need to be, but maybe there's a Neovim bug that leaks ui ext messages to other providers or something like that.

edit: there is a handler.

Not sure what the problem is then :)

@znd4
Copy link
Author

znd4 commented Oct 3, 2022

Hmm, this is very interesting, and very outside my expertise.

Does noice actually consume / modify the msg_history_show event? It doesn't look like we're actively over-riding :messages (sorry, I misread your comment earlier)

(I'm looking at the UI events documentation, but still pretty confused).

@znd4
Copy link
Author

znd4 commented Oct 3, 2022

Hmm, I'm actually getting the same error in neovide when searching with / for something that's not in a buffer (e.g. /a in an empty buffer, or in my case, /filter in :h ui-events 😆)

Or when opening a file that's being concurrently edited

Back to invalid array format false when trying to go to a mark that isn't set (should be able to repro with 'a right after starting (any lowercase letter))

I'm gonna try adding a bunch of print statements in neovide 😆

@znd4
Copy link
Author

znd4 commented Oct 4, 2022

I'm curious as to whether this is related to the default behavior of the override option for nvim_ui_attach:

false: (default) Disable UI capabilities not supported by all connected UIs (including TUI).

unfortunately, it seems like vim.ui_attach only supports the ext_* parameters of the nvim_ui_attach API

@folke
Copy link
Owner

folke commented Oct 4, 2022

Might be, but I can;t control those settings. I'm using the lua equivalent:
image

@znd4
Copy link
Author

znd4 commented Oct 4, 2022

Hmm maybe best to close this (at least for now). I created an issue in neovim asking to enable passing override in the vim.ui_attach options, although I'm not sure if that'll solve it (i.e. would neovide also need to pass in override=true?)

@folke folke closed this as completed Oct 4, 2022
@folke
Copy link
Owner

folke commented Oct 4, 2022

Not sure that option would fix it. Your best bet is Neovide since they should be able to fix it.

@folke
Copy link
Owner

folke commented Oct 24, 2022

@zdog234 in the meantime, everything seems to be working :) (but without --multigrid)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants