Shatur / neovim-session-manager

A simple wrapper around :mksession.
GNU General Public License v3.0
530 stars 52 forks source link

No syntax highlighting when loaded from `autocmd` #137

Closed Bitals closed 4 months ago

Bitals commented 4 months ago

Bug description When I call load_last_session from an autocmd, I have no syntax highlighting in the first opened file for some reason. If I later open a file in any other way, including inside this session, everything works. If I specify a file as an argument when opening, everything works. If I load another session and then reload the initial session, everything works. Just not from this function for some reason.

Config: https://github.com/Bitals/neovim-config/blob/b628864a8fe89b1be6183a4552af1f768f487837/init.lua#L54

Steps to reproduce

  1. Save a session
  2. Close and reopen Neovim
  3. See error

Expected behavior Syntax highlighting works

Screenshots No highlights: image Yes highlights: image

Environment

Additional context Terminal: Alacritty

Bitals commented 4 months ago

As can be seen on the screenshots, not only treesitter is missing, but basically half of the plugins don't work in this scenario. For some reason session-manager (I assume) prevents nvim from loading anything else when it is executed on event VimEnter

Shatur commented 4 months ago

Can't reproduce on my side.

Bitals commented 4 months ago

@Shatur with an autocmd on VimEnter?

Shatur commented 4 months ago

Yes, autoloading happens on VimEnter by default: https://github.com/Shatur/neovim-session-manager/blob/35c154a4b904cbe2aa7acce00a8c1c54a8831780/plugin/session_manager.lua#L12

Bitals commented 4 months ago

@Shatur huh, right, sorry. But this way doesn't work for my workflow, but that is a confirmed me problem now.

Shatur commented 4 months ago

Check if some other plugin causes it.