Skip to content

Conversation

@64-bitman
Copy link

Issue: opening a session file with multiple buffers open would only set bufnr for the buffer that is focused from the start. This prevents buffer local mappings and autocmds from working properly.

Opening a session file with multiple buffers open would only set bufnr for the buffer that is focused from the start.
win_execute doesn't require switching buffers, and LspAttached is called on buffers with windows (from what I can tell)

if exists('#User#LspAttached')
doautocmd <nomodeline> User LspAttached
win_execute(bufwinnr(bnr), 'doautocmd <nomodeline> User LspAttached', silent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems incorrect, winnr maybe changed or not existed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other ideas?

@GreenCourt
Copy link
Contributor

Thanks for the patch.

I tried it, but it does not trigger the LspAttached (even if the window exists).
And I had to fix the code where the variable silent wasn’t defined in the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants