Skip to content

Conversation

@ribru17
Copy link

@ribru17 ribru17 commented May 7, 2023

Problem:
I would frequently get errors while closing previewing markdown buffers saying:

Error detected while processing BufHidden Autocommands for "<buffer=1>"..function mkdp#rpc#preview_close[11]..mkdp#autocmd#clear_buf:
line    1:
E216: No such group or event: MKDP_REFRESH_INIT10

This was because the auto-close autocmd would run after the buffer was already closed, and the plugin thought it needed to close my next opened buffer (some other non-markdown file) which of course was incorrect behavior.

Solution:
I fixed this by caching the buffer number of the actual markdown buffer I needed and then passing it down to each function that needed the buffer number to close it. I would really love to see this merged as this issue was quite annoying to me. Thanks for the great plugin

@ribru17
Copy link
Author

ribru17 commented May 7, 2023

By the way I have tested this a good deal and I believe it closes #316.

@rynam0
Copy link

rynam0 commented Aug 6, 2025

I'm hitting this as well... would love a fix.

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.

2 participants