-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Summary
Remove the deprecated auto-setup mechanism from plugin/markdown-plus.lua and require users to explicitly call setup() via their plugin manager (e.g., opts = {} or config = true in lazy.nvim).
This is a follow-up to #164 and PR #169, which added a deprecation warning for auto-setup in v1.x.
Background
In v1.x, the plugin automatically called setup() when a markdown file was opened, even if the user didn't explicitly configure it. While convenient, this pattern:
- Reduces user control - Users should explicitly opt-in to plugin initialization
- Causes confusion - The
filetypesconfig option invim.g.markdown_plusonly works if set before plugin load, which is not intuitive - Adds complexity - The plugin loader has to handle edge cases for
vim.g.markdown_plusbeing a table or function
Changes Required
1. Remove auto-setup code from plugin/markdown-plus.lua
Remove the following:
get_user_config()functionget_filetypes()function- The
FileTypeautocmd that triggers auto-setup - The deprecation warning
The file should only contain the load guard:
if vim.g.loaded_markdown_plus then
return
end
vim.g.loaded_markdown_plus = 12. Remove vim.g.markdown_plus_setup_called guard
- Remove the guard variable check from
plugin/markdown-plus.lua - Remove
vim.g.markdown_plus_setup_called = truefromlua/markdown-plus/init.luasetup() - Remove
vim.g.markdown_plus_setup_called = truefromspec/minimal_init.lua
3. Update documentation
- Update README Quick Start to emphasize that
opts = {}orconfig = trueis required - Update wiki Installation page
- Update vimdoc (
doc/markdown-plus.txt)
4. Update CHANGELOG
Document this as a breaking change in the v2.0 release notes.
Migration Path
Users currently relying on auto-setup will see a deprecation warning in v1.x guiding them to add opts = {} to their plugin spec. By v2.0, they should have already migrated.
Before (v1.x - deprecated):
{
"yousefhadder/markdown-plus.nvim",
ft = "markdown",
}After (v2.0 - required):
{
"yousefhadder/markdown-plus.nvim",
ft = "markdown",
opts = {},
}Related
- Closes [BUG] don't auto-setup, do lazy load #164 (original issue)
- PR fix(config): replace vim.defer_fn with FileType autocmd for proper lazy loading #169 (added deprecation warning)
- Part of [EPIC]: v2.0 Major Update #180 (v2.0 EPIC)