Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

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

Closed
1 task done
murtaza64 opened this issue Feb 8, 2024 · 3 comments
Closed
1 task done
Labels
enhancement New feature or request

Comments

@murtaza64
Copy link

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

@murtaza64 murtaza64 added the enhancement New feature or request label Feb 8, 2024
@murtaza64 murtaza64 changed the title feature: Handle "Warning: The file has changed since reading it" natively feature: Handle "Warning: The file has been changed since reading it" natively Feb 8, 2024
@murtaza64
Copy link
Author

murtaza64 commented Feb 8, 2024

    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)

@cosmicbuffalo
Copy link

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.

@murtaza64
Copy link
Author

If anyone knows who would be a good person to reach out to in neovim core, I would appreciate some help getting my first PR merged!

Repository owner locked and limited conversation to collaborators Jun 13, 2024
@folke folke converted this issue into discussion #852 Jun 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants