Disable trimwhitespace and drawwhitespace via their configs (#1446)
Instead of completely disabling them, we now use their internal toggle. Also moved `drawwhitespace` commands inside the plugin. --- * Fixed bug where commands would show even when plugin was disbled. Also removed antiquated way of disabling. * Fixed typos. * Also moved trimwhitespace out of config, if it already has a default enabled value of false. * Changed documentation. * Clarified comments.
This commit is contained in:
@@ -107,7 +107,7 @@ end
|
||||
function command.add_defaults()
|
||||
local reg = {
|
||||
"core", "root", "command", "doc", "findreplace",
|
||||
"files", "drawwhitespace", "dialog", "log", "statusbar"
|
||||
"files", "dialog", "log", "statusbar"
|
||||
}
|
||||
for _, name in ipairs(reg) do
|
||||
require("core.commands." .. name)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
local command = require "core.command"
|
||||
local config = require "core.config"
|
||||
|
||||
command.add(nil, {
|
||||
["draw-whitespace:toggle"] = function()
|
||||
config.draw_whitespace = not config.draw_whitespace
|
||||
end,
|
||||
|
||||
["draw-whitespace:disable"] = function()
|
||||
config.draw_whitespace = false
|
||||
end,
|
||||
|
||||
["draw-whitespace:enable"] = function()
|
||||
config.draw_whitespace = true
|
||||
end,
|
||||
})
|
||||
@@ -101,8 +101,5 @@ setmetatable(config.plugins, {
|
||||
end
|
||||
})
|
||||
|
||||
-- Disable these plugins by default.
|
||||
config.plugins.trimwhitespace = false
|
||||
config.plugins.drawwhitespace = false
|
||||
|
||||
return config
|
||||
|
||||
+2
-5
@@ -531,12 +531,9 @@ local style = require "core.style"
|
||||
|
||||
------------------------------ Plugins ----------------------------------------
|
||||
|
||||
-- enable or disable plugin loading setting config entries:
|
||||
-- disable plugin loading setting config entries:
|
||||
|
||||
-- enable plugins.trimwhitespace, otherwise it is disabled by default:
|
||||
-- config.plugins.trimwhitespace = true
|
||||
--
|
||||
-- disable detectindent, otherwise it is enabled by default
|
||||
-- disable plugin detectindent, otherwise it is enabled by default:
|
||||
-- config.plugins.detectindent = false
|
||||
|
||||
---------------------------- Miscellaneous -------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user