Lsp doesn't attach on restored splits #84
Replies: 2 comments 1 reply
-
|
Probably because you are lazy-loading lsp-config incorrectly. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
It may be related to https://stackoverflow.com/questions/9281438/syntax-highlighting-doesnt-work-after-restore-a-previous-vim-session/10525050#10525050. TL;DR: use autocmd nested option. Here is my -- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
-- Subscribing to VimEnter doesn't restore bufferline pins, it seems that we need to wait for LazyVim to be ready.
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
group = vim.api.nvim_create_augroup("plaffitt_restore_session", { clear = true }),
callback = function()
-- Stop persistence and don't restore when we're opening a file.
-- The rationnal behind this is that I don't want to restore nor update a session
-- when opening a specific file that may not be related to the current project.
if vim.fn.argc(-1) > 0 then
require("persistence").stop()
else
-- Only restore if we're in a git repository.
if vim.fn.isdirectory(vim.fn.getcwd() .. "/.git") == 1 then
require("persistence").load()
end
end
end,
-- see https://stackoverflow.com/questions/9281438/syntax-highlighting-doesnt-work-after-restore-a-previous-vim-session/10525050#10525050
nested = true,
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have looked around to see if I was doing something wrong but if there was a split before closing neovim and I restored the session from dashboard, the unfocused splits doesn't get lsp attached to them.
The number of splits I have doesn't matter but only one of the split get lsp attached to them. I think an autocmd on focusgained might probably fix this but I want to know if I am the one doing something wrong.
Beta Was this translation helpful? Give feedback.
All reactions