shortcuts / no-neck-pain.nvim

☕ Dead simple yet super extensible plugin to center the currently focused buffer to the middle of the screen.
MIT License
459 stars 12 forks source link

NNP is not enabled when running :checkhealth #367

Open sand4rt opened 1 month ago

sand4rt commented 1 month ago

Description

NNP is not enabled when running :checkhealth

Steps to reproduce

  1. I did the command :checkhealth
  2. Then I saw that NNP is not enabled

Expected behavior

NNP should be enabled when running :checkhealth

Environment

shortcuts commented 1 month ago

Hey @sand4rt, thanks for opening the issue! I'm not sure what should NNP report as there's no external dependencies, maybe it could be great to do an assertion of the user config in order to report usage of deprecated/unknown options?

Let me know if you have any use cases in mind

sand4rt commented 1 month ago

Hi @shortcuts, thanks for the reply. The issue is not about the NNP checkhealth results/reports. It is that the NNP side windows are not enabled there

shortcuts commented 1 month ago

Ahhhh ok sorry I misunderstood, weirdly with one side opened only I did not noticed it, I'll try with both!

shortcuts commented 1 month ago

Hey! So I just tried it and the reason why it works for me is because I have autocmds.enableOnTabEnter set to true, not sure if you do too. As checkhealth runs in its own tab, it is required for it to work

shortcuts commented 1 month ago

Makes me think that for simplicity, I should default enableOnTabEnter if enableOnVimEnter is true, as the behavior should stay consistent

sand4rt commented 1 month ago

Hey! So I just tried it and the reason why it works for me is because I have autocmds.enableOnTabEnter set to true, not sure if you do too. As checkhealth runs in its own tab, it is required for it to work

Thanks for the reply! Ah, NNP is enabled now when autocmds.enableOnTabEnter = true is set! It's kind of slow, though, because :checkhealth runs first before NNP kicks in, but I can live with that.

I also noticed that Neovim closes completely when I use :q in a separate :checkhealth tab while NNP is enabled (it should only close the :checkhealth tab).

Makes me think that for simplicity, I should default enableOnTabEnter if enableOnVimEnter is true, as the behavior should stay consistent

That sound reasonable to me, but im also fine with adding the additional autocmds.enableOnTabEnter = true.

shortcuts commented 1 month ago

I also noticed that Neovim closes completely when I use :q in a separate :checkhealth tab while NNP is enabled (it should only close the :checkhealth tab).

looks like what I observed here https://github.com/shortcuts/no-neck-pain.nvim/issues/361#issuecomment-2120026847, it's fixed in the next major but I'll fix it here too indeed