Normalize global PATH from core.init

This commit is contained in:
Francesco Abbate 2021-02-18 09:02:57 +01:00
parent de1afb3391
commit a2c4fdf649
1 changed files with 8 additions and 1 deletions

View File

@ -350,6 +350,12 @@ function core.init()
DocView = require "core.docview"
Doc = require "core.doc"
if PATHSEP == '\\' then
USERDIR = common.normalize_path(USERDIR)
DATADIR = common.normalize_path(DATADIR)
EXEDIR = common.normalize_path(EXEDIR)
end
do
local recent_projects, window_position = load_session()
if window_position then
@ -867,11 +873,12 @@ end
core.add_save_hook(function(filename)
local doc = core.active_view.doc
if doc and doc:is(Doc) and doc.filename == common.normalize_path(USERDIR .. PATHSEP .. "init.lua") then
if doc and doc:is(Doc) and doc.filename == USERDIR .. PATHSEP .. "init.lua" then
core.reload_module("core.style")
core.load_user_directory()
end
end)
return core