aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-01-17 20:44:10 -0500
committerAdam Harrison <adamdharrison@gmail.com>2023-01-17 20:44:10 -0500
commit509858a44aedffebbbca37909c065ec0e4c5d2b5 (patch)
tree388f0af65f89cab378cf2e0e4e293dd485c33f07
parent02fea1ede8878fb2fa7b4708e11ef28b0b375152 (diff)
downloadlite-xl-plugin-manager-509858a44aedffebbbca37909c065ec0e4c5d2b5.tar.gz
lite-xl-plugin-manager-509858a44aedffebbbca37909c065ec0e4c5d2b5.zip
Added list of core dependencies so we don't generate manifest rqeuirements for them.
-rw-r--r--src/lpm.c15
-rw-r--r--src/lpm.lua8
2 files changed, 22 insertions, 1 deletions
diff --git a/src/lpm.c b/src/lpm.c
index 1d66e41..a97c917 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -977,6 +977,20 @@ int lpm_flock(lua_State* L) {
return 0;
}
+int lpm_time(lua_State* L) {
+ #if _WIN32 // Fuck I hate windows jesus chrsit.
+ LARGE_INTEGER LoggedTime, Freqency;
+ QueryPerformanceFrequency(&Frequency);
+ QueryPerformanceCounter(&LoggedTime);
+ lua_pushnumber(L, LoggedTime.QuadPart / (double)Frequency.QuadPart);
+ #else
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ lua_pushnumber(L, ts.tv_sec + ts.tv_nsec * 100000000.0);
+ #endif
+ return 1;
+}
+
static const luaL_Reg system_lib[] = {
{ "ls", lpm_ls }, // Returns an array of files.
{ "stat", lpm_stat }, // Returns info about a single file.
@@ -996,6 +1010,7 @@ static const luaL_Reg system_lib[] = {
{ "chdir", lpm_chdir }, // Changes directory. Only use for --post actions.
{ "pwd", lpm_pwd }, // Gets existing directory. Only use for --post actions.
{ "flock", lpm_flock }, // Locks a file.
+ { "time", lpm_time }, // Get high-precision system time.
{ NULL, NULL }
};
diff --git a/src/lpm.lua b/src/lpm.lua
index 2467b55..c24d8f8 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -878,6 +878,12 @@ end
-- in the cases where we don't have a manifest, assume generalized structure, take addons folder, trawl through it, build manifest that way
-- assuming each .lua file under the `addons` folder is a addon. also parse the README, if present, and see if any of the addons
+-- Ignore any requries that are in CORE_PLUGINS.
+local CORE_PLUGINS = {
+ autocomplete = true, autoreload = true, contextmenu = true, detectindent = true, drawwhitespace = true, language_c = true, language_cpp = true, language_css = true, language_dart = true,
+ language_html = true, language_js = true, language_lua = true, language_md = true, language_python = true, language_xml = true, lineguide = true, linewrapping = true, macro = true,
+ projectsearch = true, quote = true, reflow = true, scale = true, tabularize = true, toolbarview = true, treeview = true, trimwhitespace = true, workspace = true
+}
function Repository:generate_manifest(repo_id)
if not self.commit and not self.branch then error("requires an instantiation") end
local path = self.local_path
@@ -923,7 +929,7 @@ function Repository:generate_manifest(repo_id)
local _, _, mod_version = line:find("%-%-.*mod%-version:%s*(%w+)")
if mod_version then addon.mod_version = mod_version end
local _, _, required_addon = line:find("require [\"']plugins.([%w_]+)")
- if required_addon then if required_addon ~= addon.id then if not addon.dependencies then addon.dependencies = {} end addon.dependencies[required_addon] = ">=0.1" end end
+ if required_addon and not CORE_PLUGINS[required_addon] then if required_addon ~= addon.id then if not addon.dependencies then addon.dependencies = {} end addon.dependencies[required_addon] = ">=0.1" end end
end
if addon_map[addon.id] then
addon = common.merge(addon, addon_map[addon.id])