Namespace plugin-specific configuration settings.

This commit is contained in:
Adam Harrison
2021-07-15 17:58:14 -04:00
parent d10865bcc4
commit e539310e6d
5 changed files with 14 additions and 10 deletions
+6 -4
View File
@@ -8,8 +8,10 @@ local style = require "core.style"
local RootView = require "core.rootview"
local CommandView = require "core.commandview"
config.scale_mode = "code"
config.scale_use_mousewheel = true
config.plugins.scale = {
mode = "code",
use_mousewheel = true
}
local scale_level = 0
local scale_steps = 0.05
@@ -35,7 +37,7 @@ local function set_scale(scale)
-- we set scale_level in case this was called by user
scale_level = (scale - default_scale) / scale_steps
if config.scale_mode == "ui" then
if config.plugins.scale.mode == "ui" then
SCALE = scale
style.padding.x = style.padding.x * s
@@ -68,7 +70,7 @@ end
local on_mouse_wheel = RootView.on_mouse_wheel
function RootView:on_mouse_wheel(d, ...)
if keymap.modkeys["ctrl"] and config.scale_use_mousewheel then
if keymap.modkeys["ctrl"] and config.plugins.scale.use_mousewheel then
if d < 0 then command.perform "scale:decrease" end
if d > 0 then command.perform "scale:increase" end
else