Namespace plugin-specific configuration settings.
This commit is contained in:
@@ -9,7 +9,7 @@ local translate = require "core.doc.translate"
|
||||
local RootView = require "core.rootview"
|
||||
local DocView = require "core.docview"
|
||||
|
||||
config.autocomplete_max_suggestions = 6
|
||||
config.plugins.autocomplete = { max_suggestions = 6 }
|
||||
|
||||
local autocomplete = {}
|
||||
autocomplete.map = {}
|
||||
@@ -129,7 +129,7 @@ local function update_suggestions()
|
||||
-- fuzzy match, remove duplicates and store
|
||||
items = common.fuzzy_match(items, partial)
|
||||
local j = 1
|
||||
for i = 1, config.autocomplete_max_suggestions do
|
||||
for i = 1, config.autocomplete.max_suggestions do
|
||||
suggestions[i] = items[j]
|
||||
while items[j] and items[i].text == items[j].text do
|
||||
items[i].info = items[i].info or items[j].info
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -358,7 +358,7 @@ local treeview_node = node:split("left", view, {x = true}, true)
|
||||
-- in the treeview node.
|
||||
local toolbar_view = nil
|
||||
local toolbar_plugin, ToolbarView = core.try(require, "plugins.toolbarview")
|
||||
if config.toolbarview ~= false and toolbar_plugin then
|
||||
if config.plugins.toolbarview ~= false and toolbar_plugin then
|
||||
toolbar_view = ToolbarView()
|
||||
treeview_node:split("down", toolbar_view, {y = true})
|
||||
local min_toolbar_width = toolbar_view:get_min_width()
|
||||
|
||||
Reference in New Issue
Block a user