Lua/stdlib: behavior of global vs local "enable" (and other config) #28603
Labels
enhancement
feature request
lua
stdlib
needs:decision
A discussion has run its course and a decision has to be made how to proceed
needs:discussion
For PRs that propose significant changes to some part of the architecture or API
options
configuration, settings
Milestone
Problem
vim.diagnostic.enable(nil) and vim.lsp.inlay_hint.enable(nil) both actively override any buffer-local flags that were previously set by
enable(..., {bufnr=...}
.That seems a bit "destructive". I tend to think that global enable() should act like a gate:
IOW: buffer-local "enable" flag has precedence unless the feature is globally disabled.
Expected behavior
Need a clear pattern for all such modules to follow. This may have implications for other kinds of "config" besides mere "enablement".
The behavior of vim options (
:help global-local
, ignoring other kinds of option scopes) would imply that the global setting is only the "default", and any buffer-local setting should always override the global default.The text was updated successfully, but these errors were encountered: