fidget.nvim icon indicating copy to clipboard operation
fidget.nvim copied to clipboard

`override_vim_notify = true` -> notification captures cursor on `:q`

Open j-hui opened this issue 1 year ago • 4 comments

Discussed in https://github.com/j-hui/fidget.nvim/discussions/218

[!NOTE] GitHub Discussions are now disabled for this project, so the above link will 404, but the relevant discussion with @mrcjkb is reproduced below.

Originally posted by mrcjkb March 4, 2024 Hey :wave:

I really like fidget's override_vim_notify feature, as it usually doesn't get in my way, but I can look up notifications when I need them.

I've just been having one issue: Sometimes, when trying to exit with :q or :wq while fidget is displaying a notification, instead of quitting Neovim, the cursor will move to the notification window.

I can consistently reproduce this with neogit (having the disable_builtin_notifications option set to true - which disables Neogit's notifications and uses vim.notify instead)

It always happens when I

  • Modify something
  • :Neogit
  • cc to commit
  • Type the commit message and :wq to commit
  • q to close the Neogit tab - meanwhile the Committed! notification shows up in fidget.
  • :wq -> cusor moves to the fidget notification floating window (if I hit <CR> before the notification window is closed).

Here's the weird part:

I cannot reproduce the behaviour if I manually trigger the notification that Neogit sends with

:lua vim.notify("Committed!", vim.log.levels.INFO, { title = "Neogit", icon = "ó°Š¢" })

As I've only observed this behaviour with neogit notifications, I decided to put this in the Q&A. It's probably not a fidget.nvim bug...

Response by **j-hui** March 18, 2024

Ah interesting, do you also get this error message?

"somefile" 3L, 11B written
E37: No write since last change
E162: No write since last change for buffer "[No Name]"
Press ENTER or type command to continue

I'm able to reproduce this issue, though am a little puzzled about what the cause might be. In particular, I'm not sure which buffer it is that was modified but has unsaved changes (the buffer for the Git-tracked somefile is clean).

Response by **mrcjkb** March 20, 2024

Yes, I think I was seeing similar error messages.

Response by **mrcjkb** March 21, 2024

Yep, I can confirm I am getting the same error message. It's quite consistent with neogit, but I haven't observed it anywhere else.

j-hui avatar May 20 '24 16:05 j-hui

Sorry for the outside topic but, Is it possible to config Fidget to be able to show all of these priting messages ?

Image

Sirikakire avatar Feb 18 '25 08:02 Sirikakire

@Sirikakire I'm not aware of how to do so, but you should file a new issue for unrelated questions like these. I also advise you to look into noice.nvim, I believe it advertises some features like what you are looking for.

j-hui avatar Feb 25 '25 23:02 j-hui

Sorry for the outside topic but, Is it possible to config Fidget to be able to show all of these priting messages ?

Image

That requires a deeper integration with nvim_ui_attach like noice.nvim does it. That also includes replacing the cmd line etc. I think it's out of scope for fidget itself, but someone could make a shim or adapter as a separate plugin, which allows rerouting of ext_messages to any other backend

nerdwave-nick avatar Apr 25 '25 15:04 nerdwave-nick

Note to self: this might be fixed by #279, but I need to double-check...

j-hui avatar Jul 28 '25 07:07 j-hui