fix(modules): enabling disabling per buffer and globally

When a module is disabled by default in the config, running
TSBufEnable will not enable the module because the is_enabled
function will always return false, thus the module not being enabled.
Also, disabling/enabling the buffers is flaky.

This commit adds per buffer check when the module is not disabled. It
also makes the enable and disable more indempotent.

i've also renamed TS*All to TS*.

Fixes #2754
This commit is contained in:
kiyan 2022-04-09 14:41:07 +02:00 committed by Christian Clason
parent e3adb39586
commit 7141393f12
3 changed files with 45 additions and 19 deletions

View file

@ -269,8 +269,8 @@ Toggle (enable if disabled, disable if enabled) {module} on the current
buffer.
A list of modules can be found at |:TSModuleInfo|
*:TSEnableAll*
:TSEnableAll {module} [{language}]~
*:TSEnable*
:TSEnable {module} [{language}]~
Enable {module} for the session.
If {language} is specified, enable module for the session only for this
@ -278,8 +278,8 @@ particular language.
A list of modules can be found at |:TSModuleInfo|
A list of languages can be found at |:TSInstallInfo|
*:TSDisableAll*
:TSDisableAll {module} [{language}]~
*:TSDisable*
:TSDisable {module} [{language}]~
Disable {module} for the session.
If {language} is specified, disable module for the session only for this
@ -287,8 +287,8 @@ particular language.
A list of modules can be found at |:TSModuleInfo|
A list of languages can be found at |:TSInstallInfo|
*:TSToggleAll*
:TSToggleAll {module} [{language}]~
*:TSToggle*
:TSToggle {module} [{language}]~
Toggle (enable if disabled, disable if enabled) {module} for the session.
If {language} is specified, toggle module for the session only for this