mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-21 18:25:41 +03:00
75 lines
3.2 KiB
Diff
75 lines
3.2 KiB
Diff
Upstream: Issue opened: https://github.com/rxi/lite/issues/49
|
|
Reason: Right now lite just assumes that the data directory will be right
|
|
next to the binary, but we want the binary in /usr/bin and the data in
|
|
/usr/share/lite-editor
|
|
|
|
diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua
|
|
index 5c9d622..568f0ef 100644
|
|
--- a/data/core/commands/core.lua
|
|
+++ b/data/core/commands/core.lua
|
|
@@ -85,7 +85,7 @@ command.add(nil, {
|
|
end,
|
|
|
|
["core:open-user-module"] = function()
|
|
- core.root_view:open_doc(core.open_doc(EXEDIR .. "/data/user/init.lua"))
|
|
+ core.root_view:open_doc(core.open_doc("/usr/share/lite-editor/data/user/init.lua"))
|
|
end,
|
|
|
|
["core:open-project-module"] = function()
|
|
diff --git a/data/core/init.lua b/data/core/init.lua
|
|
index a25cdb5..3bea486 100644
|
|
--- a/data/core/init.lua
|
|
+++ b/data/core/init.lua
|
|
@@ -150,7 +150,7 @@ end
|
|
|
|
function core.load_plugins()
|
|
local no_errors = true
|
|
- local files = system.list_dir(EXEDIR .. "/data/plugins")
|
|
+ local files = system.list_dir("/usr/share/lite-editor/data/plugins")
|
|
for _, filename in ipairs(files) do
|
|
local modname = "plugins." .. filename:gsub(".lua$", "")
|
|
local ok = core.try(require, modname)
|
|
@@ -421,7 +421,7 @@ end
|
|
|
|
function core.on_error(err)
|
|
-- write error to file
|
|
- local fp = io.open(EXEDIR .. "/error.txt", "wb")
|
|
+ local fp = io.open("/tmp/lite-editor-error.txt", "wb")
|
|
fp:write("Error: " .. tostring(err) .. "\n")
|
|
fp:write(debug.traceback(nil, 4))
|
|
fp:close()
|
|
diff --git a/data/core/style.lua b/data/core/style.lua
|
|
index ab597c2..23b551f 100644
|
|
--- a/data/core/style.lua
|
|
+++ b/data/core/style.lua
|
|
@@ -7,10 +7,10 @@ style.scrollbar_size = common.round(4 * SCALE)
|
|
style.caret_width = common.round(2 * SCALE)
|
|
style.tab_width = common.round(170 * SCALE)
|
|
|
|
-style.font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", 14 * SCALE)
|
|
-style.big_font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", 34 * SCALE)
|
|
-style.icon_font = renderer.font.load(EXEDIR .. "/data/fonts/icons.ttf", 14 * SCALE)
|
|
-style.code_font = renderer.font.load(EXEDIR .. "/data/fonts/monospace.ttf", 13.5 * SCALE)
|
|
+style.font = renderer.font.load("/usr/share/lite-editor/data/fonts/font.ttf", 14 * SCALE)
|
|
+style.big_font = renderer.font.load("/usr/share/lite-editor/data/fonts/font.ttf", 34 * SCALE)
|
|
+style.icon_font = renderer.font.load("/usr/share/lite-editor/data/fonts/icons.ttf", 14 * SCALE)
|
|
+style.code_font = renderer.font.load("/usr/share/lite-editor/data/fonts/monospace.ttf", 13.5 * SCALE)
|
|
|
|
style.background = { common.color "#2e2e32" }
|
|
style.background2 = { common.color "#252529" }
|
|
diff --git a/src/main.c b/src/main.c
|
|
index d282a9a..50eedb5 100644
|
|
--- a/src/main.c
|
|
+++ b/src/main.c
|
|
@@ -119,8 +119,8 @@
|
|
" SCALE = tonumber(os.getenv(\"LITE_SCALE\")) or SCALE\n"
|
|
" PATHSEP = package.config:sub(1, 1)\n"
|
|
" EXEDIR = EXEFILE:match(\"^(.+)[/\\\\].*$\")\n"
|
|
- " package.path = EXEDIR .. '/data/?.lua;' .. package.path\n"
|
|
- " package.path = EXEDIR .. '/data/?/init.lua;' .. package.path\n"
|
|
+ " package.path = '/usr/share/lite-editor/data/?.lua;' .. package.path\n"
|
|
+ " package.path = '/usr/share/lite-editor/data/?/init.lua;' .. package.path\n"
|
|
" core = require('core')\n"
|
|
" core.init()\n"
|
|
" core.run()\n"
|
|
|