folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
4.21k stars 95 forks source link

Not compatible with neovide #17

Closed nick4tech closed 1 year ago

nick4tech commented 1 year ago

Describe the bug I've installed the plugin with packer. Used one of the config recipes from the wiki but I can't get it to work.

To Reproduce Install with Packer Copy the config recipe from the wiki:

  use {
    'folke/noice.nvim',
    event = "VimEnter",
    requires = {
      -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
      "MunifTanjim/nui.nvim",
      "rcarriga/nvim-notify",
      "hrsh7th/nvim-cmp",
    },
    config = function()
      require("noice").setup({
        views = {
          cmdline_popup = {
            border = {
              style = "none",
              padding = { 2, 3 },
            },
            filter_options = {},
            win_options = {
              winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
            },
          },
        },
        routes = {
          {
            filter = {
              event = "cmdline",
              find = "^%s*[/?]",
            },
            view = "cmdline",
          },
        },
      })
    end
  }

I also tried without lazy loading and still didn't work. Also tried running Noice enable, didn't work.

Expected behavior I'd expect the command line to appear in a popup on the center of the screen.

Screenshots image

This is how my command line looks.

Noice log Noice log is empty. Here are the stats: image

folke commented 1 year ago

In the route, you specify it needs to go to the cmdline. If you want the popup, change this to cmdline_popup. You also wont have syntax highlighting, since you removed the opts with filtetype vim.

Just remove the routes in your config.

folke commented 1 year ago

Nevermind, that's for the search cmdline

folke commented 1 year ago

Just tried your config and it works for me. Are you using Neoivm 0.8.0? Do you use a gui?

nick4tech commented 1 year ago

So I removed all the configs and just stuck to the default. I think I know what's happening. It seems to be incompatible with neovide, which the gui I use. I tried running it from nvim in terminal and it worked.

Shougo commented 1 year ago

Please see this.

https://github.com/folke/noice.nvim/issues/10

folke commented 1 year ago

For me the popup etc does work in the latest Neovide version, but there's another issue with :messages that crashes Neovide.

I'll keep this open for now and will add it to the tracking issue

clason commented 1 year ago

Is this with our without --multigrid?

alerque commented 1 year ago

I run Neovide with --multigrid and am not able to use noice with it.

folke commented 1 year ago

So I just tested again with the latest version of Neovide, Neovim & Noice, and everything seems to be working now :)

I pushed a change, so that Noice still shows a warning of running inside Neovide, but it will start.

Would be great if others can test as well to see that everything is working inside Neovide now.

@clason with --multigrid, something is broken. No errors, but Noice can't seem to override the cmdline.

folke commented 1 year ago

@alerque try without multigrid. It seems to work fine for me

clason commented 1 year ago

@clason with --multigrid

That would be my expectation as well; multigrid has a number of issues with newer TUI functionality.

alerque commented 1 year ago

@folke What's the point? When I want to forego smooth scrolling to get noice features I just run NeoVIM in a terminal.

folke commented 1 year ago

@alerque the point was to test and see if that works for you as well, so we can narrow down the issue to --multigrid

clason commented 1 year ago

In any case, can I suggest turning the hard error into a warning, even with multigrid? A lot of features still work fine.

alerque commented 1 year ago

Sorry @folke I thought that had been determined already.

Yes if I disable --multigrid it seems to run fine.

folke commented 1 year ago

@clason did that already :)

james2doyle commented 1 year ago

Just tested with the latest build of Neovide (not using multigrid) from the main branch with the latest changes on noice and it seems to work:

Screen Shot 2022-10-24 at 11 27 32 AM

There is this error when opening the command prompt

Screen Shot 2022-10-24 at 11 29 00 AM

folke commented 1 year ago

@james2doyle that doens't seem right. Thats the call to vim.treesitter.

It seems like your installation (runtime directory) is messed up.

james2doyle commented 1 year ago

Ah ok. I will look into that. I used to build from source before 0.8 was out so I am sure it is a holdover from the mess I made

clason commented 1 year ago

Very likely then. Clean out your runtime directory and install again.

james2doyle commented 1 year ago

Got it. I had a custom set ENV VAR for it and once it was removed it worked perfectly

unrealapex commented 1 year ago

Neovide crashes when using keymaps with multiple Ex-commands. Here is a minimal reproducible example that causes the bug:

vim.keymap.set('n', '<C-l>', ':echo<CR>:echo<CR>:echo<CR>')

@folke do you think I should create an issue for this or should Neovide related issues be put here?

khalidchawtany commented 1 year ago

@UnrealApex the same happens in neovim-qt. However, its neovim’s bug, as no plugin should be able to make it crash https://github.com/folke/noice.nvim/issues/106

unrealapex commented 1 year ago

Unfortunately certain errors do make Neovide crash. Hence why this issue was opened.

folke commented 1 year ago

@UnrealApex @khalidchawtany is right, there's little I can do to prevent those crashes. Either a bug on the Neovim or Neovide side.

I keep this issue open to track what works and what doesn't. It's not possible for me to fix any of these issues.

folke commented 1 year ago

The specific issue @khalidchawtany was refering to, is fixed on the latest Neovim nightly.

If you want to help testing Neovide, make sure to only report issues here that happen on nightly. We know there's a bunch of issues with Neovide, Noice and Neovim stable.

unrealapex commented 1 year ago

Ah I understand, thank you for the clarification! I will make sure to test issues on nightly.

sid-6581 commented 1 year ago

So to add another datapoint, I tested with the latest noice, neovim nightly 162, and the latest neovide built from source. I'm not using --multigrid. I very quickly get crashes in neovide after just a couple of keystrokes. I ran neovide in the debugger, and so far the crashes have all been on the redraw event, with a panic saying Could not parse event from neovim with various descriptions.

I'm using packer, and copied and pasted the basic example setup with no customizations. If I remove noice, neovide no longer crashes.

folke commented 1 year ago

@sid-6581 that's the errors I used to get, but they're gone for me now

unrealapex commented 1 year ago

@UnrealApex @khalidchawtany is right, there's little I can do to prevent those crashes. Either a bug on the Neovim or Neovide side.

Keymaps with multiple commands work fine in nightly(TUI).

folke commented 1 year ago

fyi: I was able to work around an issue where Neovide would crash almost immediately, event without multigrid.

sid-6581 commented 1 year ago

fyi: I was able to work around an issue where Neovide would crash almost immediately, event without multigrid.

The crashes seem to be gone as far as I can tell, thanks! However, there are some new issues. Every character I type on the cmdline or search results in this on Windows (neovide and neovim-qt both):

image

Also, the search string appears to not go away:

image

It seems like noice just stops functioning at this point, because the cmdline is back to non-noice, and messages are also displayed normally:

image

image

This appears to be a Windows-only issue.

folke commented 1 year ago

Can you check if it works in TUI?

The error you're seeing is because of missing symbols in the Neovim that Neovide uses.

It shouldn't trigger issues in TUI.

sid-6581 commented 1 year ago

Sorry, I forgot to mention that it's also a problem in TUI on Windows. It behaves exactly the same, so it's not just a GUI issue. TUI on Linux (in WSL2) doesn't have this issue.

In WSL I'm running neovim nightly installed through homebrew, which is currently NVIM v0.9.0-dev-1537+gc404f9b4b-dirty.

In Windows I'm running neovim nightly installed through scoop, which is currently NVIM v0.9.0-dev-326+gfa7e1e260.

I'm not sure if that makes a difference. I update everything every day, and everything was working yesterday. (Except neovide was probably crashing, but I wouldn't have noticed because I switched to neovim-qt so I could use noice.)

sid-6581 commented 1 year ago

Just wanted to follow up and say that it looks like the latest commit fixed the issue! No crashes and no warnings on Windows/Neovide so far. Thanks a lot, your hard work with all your plugins is extremely appreciated.

jinzhongjia commented 1 year ago

em... now,on archlinux, it still crash, but I can see the cmdline before crashing Now, I use the neovim(nightly version),and neovide is 0.10.3

folke commented 1 year ago

it doesn't crash for me on Fedora. Are you sure you're using the latest version?

alerque commented 1 year ago

I think you'd need the Neovide VCS package and compile the HEAD version for this to work.

jinzhongjia commented 1 year ago

@alerque @folke I try compile neovide(branch is main) on my archlinux, and compile successfully, launch it well, but when I get the cmdline, it crashes and the console print these:

ERROR [neovide::error_handling] Could not parse event from neovim: invalid array format 0
thread 'tokio-runtime-worker' panicked at 'Could not parse event from neovim: invalid array format 0', 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 13 panicked'
jinzhongjia commented 1 year ago

@alerque @folke I try compile neovide(branch is main) on my archlinux, and compile successfully, launch it well, but when I get the cmdline, it crashes and the console print these:

ERROR [neovide::error_handling] Could not parse event from neovim: invalid array format 0
thread 'tokio-runtime-worker' panicked at 'Could not parse event from neovim: invalid array format 0', 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 13 panicked'

I didn't know why it will crash.

jinzhongjia commented 1 year ago

@alerque @folke I try compile neovide(branch is main) on my archlinux, and compile successfully, launch it well, but when I get the cmdline, it crashes and the console print these:

ERROR [neovide::error_handling] Could not parse event from neovim: invalid array format 0
thread 'tokio-runtime-worker' panicked at 'Could not parse event from neovim: invalid array format 0', 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 13 panicked'

and my noice's config is default

jinzhongjia commented 1 year ago

It is very strange, I found that when I called up the cmdline on the dashboard, it would crash, but it would not crash on other pages so that means the plugin dashboard.nvim cause crashing?

jinzhongjia commented 1 year ago

when I disable dashboard.nvim, it works well.......

jinzhongjia commented 1 year ago

Now, I have replaced dashboard.nvim to alpha.nvim , neovide works well

luiz00martins commented 1 year ago

fyi: I was able to work around an issue where Neovide would crash almost immediately, event without multigrid.

I think I'm getting this error on Windows. Open up Neovide, type :, and it crashes.

This is what's printed (on terminal) upon failure:

ERROR [neovide::error_handling] Could not parse event from neovim: invalid array format true
thread 'tokio-runtime-worker' panicked at 'Could not parse event from neovim: invalid array format true', 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 13 panicked'
Icy-Thought commented 1 year ago

Managed to reduce the experienced failure to:

Relevant info:

shaunsingh commented 1 year ago

Is there something we can do on the neovide end to improve the multigrain experience? From what I understand, noice is taking advantage of ext_cmdline, which neovide --multigrid handles.

dashboard.nvim Is the issue reproducable without noice? in which case please open a ticket in the neovide repo. My guess is that neovide like to crash on os.execute due to another upstream issue and dashboard.nvim like to call it, somewhere

Ciel-MC commented 1 year ago

Tried it today, Neovide 0.10.3-1 with multigrid disabled seems to function fine so far. (Linux)

Edit: Nevermind lmao, trying to delete multiple lines crashes Neovide.

ryo33 commented 1 year ago

https://github.com/ryo33/neovide/commit/1c0ef4dc1d1d2f7c319c62247569277cea9f0dd1 This patch should help to investigate this issue (Tell me if anybody knows a better way to debug-print the event that causes a crash.

ryo33 commented 1 year ago

I've opened https://github.com/neovim/neovim/issues/22344 for this.