folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature: Handle "Warning: The file has been changed since reading it" natively

murtaza64 opened this issue · comments

Did you check the docs?

  • I have read all the noice.nvim docs

Is your feature request related to a problem? Please describe.

Currently, this message goes to my regular messages (which I personally use the mini view for):
image

Describe the solution you'd like

It would be best if this was a user input prompt (i.e. in the middle of the screen), like what happens when you try to open a file that has a swapfile.

Describe alternatives you've considered

I suppose I could set up a filter, but I'm not sure if that would handle getting user input since the message type seems to be msg_show

Additional context

No response

    routes = {
      {
        filter = { event = "msg_show", find = "Do you really want to" },
        view = "popup",
      },
    },

I tried stuff like this but it doesn't seem to work very well, it looks like this message isn't implemented like other input prompts in neovim (sorry I'm exhausted but I can provide a better description if you need one)

I've also been trying to figure out an elegant solution for this. I've been using the notify view for messages and I can't seem to get the lines for the prompt to merge into one notification. The best I've got so far is a route like this:

{
  view = "notify",
  filter = {
    event = "msg_show",
    ["not"] = { kind = { "confirm", "confirm_sub", "search_count" } },
  },
  opts = { replace = false, merge = true, title = "Merge Attempt" },
},

it at least prevents the notifications that pop up from replacing each other, but it still doesn't merge them together. This is what it spits out for me:

Screenshot 2024-04-15 at 8 27 28 PM

ignore that return StatusCol(...)item in there, I'm debugging that separately. Ideally the behavior I'm looking for from noice is just for those three notify bubbles to be combined into one, or to be turned into a confirm popup like the issue author suggests. Appreciate any help I can get.