2023-02-06 18:32:44 +01:00
|
|
|
local common = require "core.common"
|
|
|
|
|
2019-12-28 12:16:32 +01:00
|
|
|
local config = {}
|
|
|
|
|
|
|
|
config.fps = 60
|
2022-07-01 05:27:18 +02:00
|
|
|
config.max_log_items = 800
|
2021-05-27 08:28:58 +02:00
|
|
|
config.message_timeout = 5
|
2020-05-16 10:46:31 +02:00
|
|
|
config.mouse_wheel_scroll = 50 * SCALE
|
2022-04-26 15:54:11 +02:00
|
|
|
config.animate_drag_scroll = false
|
2021-09-30 22:10:38 +02:00
|
|
|
config.scroll_past_end = true
|
2024-02-11 18:51:12 +01:00
|
|
|
---@type "expanded" | "contracted" | false @Force the scrollbar status of the DocView
|
2022-11-01 23:38:50 +01:00
|
|
|
config.force_scrollbar_status = false
|
2019-12-28 12:16:32 +01:00
|
|
|
config.file_size_limit = 10
|
2022-10-20 04:23:01 +02:00
|
|
|
config.ignore_files = {
|
|
|
|
-- folders
|
|
|
|
"^%.svn/", "^%.git/", "^%.hg/", "^CVS/", "^%.Trash/", "^%.Trash%-.*/",
|
|
|
|
"^node_modules/", "^%.cache/", "^__pycache__/",
|
|
|
|
-- files
|
|
|
|
"%.pyc$", "%.pyo$", "%.exe$", "%.dll$", "%.obj$", "%.o$",
|
|
|
|
"%.a$", "%.lib$", "%.so$", "%.dylib$", "%.ncb$", "%.sdf$",
|
|
|
|
"%.suo$", "%.pdb$", "%.idb$", "%.class$", "%.psd$", "%.db$",
|
|
|
|
"^desktop%.ini$", "^%.DS_Store$", "^%.directory$",
|
|
|
|
}
|
2019-12-28 12:16:32 +01:00
|
|
|
config.symbol_pattern = "[%a_][%w_]*"
|
|
|
|
config.non_word_chars = " \t\n/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-"
|
|
|
|
config.undo_merge_timeout = 0.3
|
|
|
|
config.max_undos = 10000
|
2021-10-02 18:44:05 +02:00
|
|
|
config.max_tabs = 8
|
|
|
|
config.always_show_tabs = true
|
2024-02-11 18:51:12 +01:00
|
|
|
-- Possible values: false, true, "no_selection"
|
2019-12-28 12:16:32 +01:00
|
|
|
config.highlight_current_line = true
|
|
|
|
config.line_height = 1.2
|
|
|
|
config.indent_size = 2
|
|
|
|
config.tab_type = "soft"
|
2022-11-03 17:40:27 +01:00
|
|
|
config.keep_newline_whitespace = false
|
2019-12-28 12:16:32 +01:00
|
|
|
config.line_limit = 80
|
2020-11-16 14:45:45 +01:00
|
|
|
config.max_project_files = 2000
|
2021-02-21 11:08:25 +01:00
|
|
|
config.transitions = true
|
2022-04-26 02:35:35 +02:00
|
|
|
config.disabled_transitions = {
|
|
|
|
scroll = false,
|
|
|
|
commandview = false,
|
|
|
|
contextmenu = false,
|
|
|
|
logview = false,
|
|
|
|
nagbar = false,
|
|
|
|
tabs = false,
|
|
|
|
tab_drag = false,
|
|
|
|
statusbar = false,
|
|
|
|
}
|
2021-03-10 16:35:37 +01:00
|
|
|
config.animation_rate = 1.0
|
2021-03-06 11:03:12 +01:00
|
|
|
config.blink_period = 0.8
|
2021-10-02 16:38:10 +02:00
|
|
|
config.disable_blink = false
|
2021-03-31 17:33:35 +02:00
|
|
|
config.draw_whitespace = false
|
2021-04-21 09:05:15 +02:00
|
|
|
config.borderless = false
|
2021-06-18 03:35:36 +02:00
|
|
|
config.tab_close_button = true
|
2021-11-14 21:44:54 +01:00
|
|
|
config.max_clicks = 3
|
2019-12-28 12:16:32 +01:00
|
|
|
|
2024-02-11 18:51:12 +01:00
|
|
|
-- set as true to be able to test non supported plugins
|
2022-03-11 03:29:33 +01:00
|
|
|
config.skip_plugins_version = false
|
|
|
|
|
2023-02-06 18:32:44 +01:00
|
|
|
-- holds the plugins real config table
|
|
|
|
local plugins_config = {}
|
|
|
|
|
2023-02-06 18:32:44 +01:00
|
|
|
-- virtual representation of plugins config table
|
2021-07-13 16:14:00 +02:00
|
|
|
config.plugins = {}
|
2023-02-06 18:32:44 +01:00
|
|
|
|
|
|
|
-- allows virtual access to the plugins config table
|
2022-01-28 22:30:19 +01:00
|
|
|
setmetatable(config.plugins, {
|
2023-02-06 18:32:44 +01:00
|
|
|
__index = function(_, k)
|
|
|
|
if not plugins_config[k] then
|
|
|
|
plugins_config[k] = { enabled = true, config = {} }
|
|
|
|
end
|
|
|
|
if plugins_config[k].enabled ~= false then
|
|
|
|
return plugins_config[k].config
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end,
|
|
|
|
__newindex = function(_, k, v)
|
|
|
|
if not plugins_config[k] then
|
|
|
|
plugins_config[k] = { enabled = nil, config = {} }
|
|
|
|
end
|
|
|
|
if v == false and package.loaded["plugins."..k] then
|
|
|
|
local core = require "core"
|
|
|
|
core.warn("[%s] is already enabled, restart the editor for the change to take effect", k)
|
|
|
|
return
|
|
|
|
elseif plugins_config[k].enabled == false and v ~= false then
|
|
|
|
plugins_config[k].enabled = true
|
|
|
|
end
|
|
|
|
if v == false then
|
|
|
|
plugins_config[k].enabled = false
|
|
|
|
elseif type(v) == "table" then
|
|
|
|
plugins_config[k].enabled = true
|
|
|
|
plugins_config[k].config = common.merge(plugins_config[k].config, v)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
__pairs = function()
|
|
|
|
return coroutine.wrap(function()
|
|
|
|
for name, status in pairs(plugins_config) do
|
|
|
|
coroutine.yield(name, status.config)
|
|
|
|
end
|
|
|
|
end)
|
2022-01-28 22:30:19 +01:00
|
|
|
end
|
2021-12-06 00:32:20 +01:00
|
|
|
})
|
2021-07-13 16:14:00 +02:00
|
|
|
|
2021-01-13 14:50:24 +01:00
|
|
|
|
2019-12-28 12:16:32 +01:00
|
|
|
return config
|