Skip to content

fix: Exec BufRead and BufReadPre after load#75

Open
Dom324 wants to merge 1 commit intostevearc:masterfrom
Dom324:fix-gitsigns-lsp
Open

fix: Exec BufRead and BufReadPre after load#75
Dom324 wants to merge 1 commit intostevearc:masterfrom
Dom324:fix-gitsigns-lsp

Conversation

@Dom324
Copy link
Copy Markdown

@Dom324 Dom324 commented Jul 3, 2025

Fixes #69

The root cause of the issue is that when resession restores the old buffer, it does not trigger BufReadPre/BufRead/BufReadPost autocommands which many plugin features depend on (gitsigns, lsp, etc.). Manually triggering these events with nvim_exec_autocmds fixes the issue.

Autocommands triggered before the fix when loading a session:

FileType
FileType
FileType

Autocommands triggered after the fix when loading a session:

BufReadPre
BufRead
BufReadPost
FileType
FileType

@github-actions github-actions bot requested a review from stevearc July 3, 2025 19:47
@Red-M
Copy link
Copy Markdown

Red-M commented Aug 17, 2025

I've tested this and while some plugins are ok with it, things like kevinhwang91/nvim-ufo didn't like it at all.

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.

bug: gitsigns and dropbar do not load

2 participants