From 3a38ded3965b7c201641194d06f6fdf5547beba3 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sun, 13 Dec 2020 13:04:06 +0100 Subject: [PATCH] Use core.reload_module instead of style.load --- data/core/init.lua | 3 ++- data/core/style.lua | 6 ------ data/user/init.lua | 3 ++- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/data/core/init.lua b/data/core/init.lua index 1985223..4a85a08 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -175,12 +175,13 @@ local function write_user_init_file(init_filename) -- this module will be loaded after everything else when the application starts -- it will be automatically reloaded when saved +local core = require "core" local keymap = require "core.keymap" local config = require "core.config" local style = require "core.style" -- light theme: --- style.load("colors.summer") +-- core.reload_module("colors.summer") -- key binding: -- keymap.add { ["ctrl+escape"] = "core:quit" } diff --git a/data/core/style.lua b/data/core/style.lua index 45492a6..1084540 100644 --- a/data/core/style.lua +++ b/data/core/style.lua @@ -53,10 +53,4 @@ style.syntax["string"] = { common.color "#f7c95c" } style.syntax["operator"] = { common.color "#93DDFA" } style.syntax["function"] = { common.color "#93DDFA" } - -style.load = function(module_name) - package.loaded[module_name] = nil - require(module_name) -end - return style diff --git a/data/user/init.lua b/data/user/init.lua index afaa610..ab4a62a 100644 --- a/data/user/init.lua +++ b/data/user/init.lua @@ -2,12 +2,13 @@ -- this module will be loaded after everything else when the application starts -- it will be automatically reloaded when saved +local core = require "core" local keymap = require "core.keymap" local config = require "core.config" local style = require "core.style" -- light theme: --- style.load("colors.summer") +-- core.reload_module("colors.summer") -- key binding: -- keymap.add { ["ctrl+escape"] = "core:quit" }