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
552 stars 13 forks source link

Doesn't work with persisted.nvim #350

Closed okkdev closed 4 months ago

okkdev commented 4 months ago

Description

When I use NoNeckPain and exit neovim. Next time I open nvim, persisted.nvim should load my last session, but it instead opens the neovim start page. I'm not sure if this is an issue with NoNeckPain or Persisted. If it's something with Persisted I'll gladly report it over there. :)

Steps to reproduce

Installed persisted.nvim with autoload enabled.

  1. nvim
  2. open a file
  3. :NoNeckPain
  4. :q
  5. nvim

Expected behavior

Should open the last opened file at the same position.

Environment

okkdev commented 4 months ago

Okay seems to be more Persisted related. When I enable scratch pads, persisted reopens that.

I guess I'll have to teach persisted how to ignore them.

Tried this, but doesn't work:

vim.api.nvim_create_autocmd("User", {
  pattern = "PersistedSavePre", 
  callback = function
    require("no-neck-pain").disable()
  end
}) 
okkdev commented 4 months ago

I asked the question in the persisted.nvim discussions: https://github.com/olimorris/persisted.nvim/discussions/128

shortcuts commented 4 months ago

Thanks a lot for using the plugin @okkdev and investigating the issue, if there is any help needed on my side don't hesitate to ping!