folke / persistence.nvim

💾 Simple session management for Neovim
Apache License 2.0
655 stars 25 forks source link

bug: Line numbers disappear when restoring session #35

Closed joebonneau closed 11 months ago

joebonneau commented 11 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.2

Operating system/version

MacOS 13.6

Describe the bug

Using the default configuration for persistence.nvim that lazyvim ships with

When I restore a session, the line numbers (in this case, I'm using relative numbers) disappear. They do not return if I try to run :set relativenumber or :set number. The only way that I'm able to get them back is to close nvim and reopen the files manually.

Thanks in advance!

Steps To Reproduce

  1. Open at least one buffer
  2. Close nvim
  3. Reopen nvim and restore the last session

Expected Behavior

line numbers will appear as they did in the previous sessionk

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
folke commented 11 months ago

There was an issue with LazyVim's new news feature. Whenever news was shown, it messed up some global options. This has been fixed somewhere yesterday, but your existing sessions might still be wrong.

Try with opening NEovim, open some files, restart and load the session. Line numbers should work again as normal.

joebonneau commented 11 months ago

Hi @folke - thanks for the quick response. I tried the approach you suggested and I'm still not seeing any line numbers after restoring the session.

I took a quick video of what it looks like (apparently asciinema doesn't like nerd font symbols): https://asciinema.org/a/MV8VD3IXKVQof91KBTmiexNbm

folke commented 11 months ago

I can't reproduce this at all.

Have you tried with a fresh starter?

joebonneau commented 11 months ago

Just tried cloning the fresh starter and adding my config back in and the issue is still there. I'm wondering if there's some weird interaction with how I have things configured, but I'm certainly not going to ask you to pick through it to find a cause 😄

I'll keep at it and let you know if I manage to figure it out. Thanks for the help so far.