diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | manifest.json | 2 | ||||
-rw-r--r-- | plugins/plugin_manager/plugin_view.lua | 10 | ||||
-rw-r--r-- | src/lpm.lua | 15 |
4 files changed, 17 insertions, 12 deletions
@@ -93,3 +93,5 @@ lpm --help CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres LZMA_CONFIGURE="--host=x86_64-w64-mingw32" ARCHIVE_CONFIGURE="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows" CURL_CONFIGURE="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows" GIT2_CONFIGURE="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DBUILD_CLAR=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DDLLTOOL=x86_64-w64-mingw32-dlltool" SSL_CONFIGURE=mingw ./build.sh -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"' ``` +## Details + diff --git a/manifest.json b/manifest.json index 51bacf5..fe92443 100644 --- a/manifest.json +++ b/manifest.json @@ -37,7 +37,7 @@ } ], "remotes": [ - "https://github.com/lite-xl/lite-xl-plugins.git:2.1", + "https://github.com/lite-xl/lite-xl-plugins.git:master", "https://github.com/adamharrison/lite-xl-simplified.git:master" ] } diff --git a/plugins/plugin_manager/plugin_view.lua b/plugins/plugin_manager/plugin_view.lua index 3972cf4..4cc2502 100644 --- a/plugins/plugin_manager/plugin_view.lua +++ b/plugins/plugin_manager/plugin_view.lua @@ -33,7 +33,7 @@ function PluginView:new() PluginView.super.new(self) self.scrollable = true self.show_incompatible_plugins = false - self.plugin_table_columns = { "Name", "Version", "Modversion", "Status", "Tags", "Description" } + self.plugin_table_columns = { "Name", "Version", "Modversion", "Status", "Tags", "Author", "Description" } self.hovered_plugin = nil self.hovered_plugin_idx = nil self.selected_plugin = nil @@ -48,7 +48,7 @@ function PluginView:new() end local function get_plugin_text(plugin) - return plugin.name, plugin.version, plugin.mod_version, plugin.status, join(", ", plugin.tags), plugin.description-- (plugin.description or ""):gsub("%[[^]+%]%([^)]+%)", "") + return plugin.name, plugin.version, plugin.mod_version, plugin.status, join(", ", plugin.tags), plugin.author or "unknown", plugin.description-- (plugin.description or ""):gsub("%[[^]+%]%([^)]+%)", "") end @@ -157,7 +157,7 @@ function PluginView:draw() end x = x + style.padding.x for j, v in ipairs({ get_plugin_text(plugin) }) do - local color = (plugin.status == "installed" or plugin.status == "orphan") and style.good or + local color = (plugin.status == "installed" or plugin.status == "bundled" or plugin.status == "orphan") and style.good or (plugin.status == "core" and style.warn or (plugin.status == "special" and style.modified or style.text) ) @@ -226,12 +226,12 @@ end, { ["plugin-manager:install-hovered"] = function() plugin_view:install(plugin_view.hovered_plugin) end }) command.add(function() - return core.active_view and core.active_view:is(PluginView) and plugin_view.selected_plugin and (plugin_view.selected_plugin.status == "installed" or plugin_view.selected_plugin.status == "orphan") + return core.active_view and core.active_view:is(PluginView) and plugin_view.selected_plugin and (plugin_view.selected_plugin.status == "installed" or plugin_view.selected_plugin.status == "orphan" or plugin_view.selected_plugin.status == "bundled") end, { ["plugin-manager:uninstall-selected"] = function() plugin_view:uninstall(plugin_view.selected_plugin) end }) command.add(function() - return core.active_view and core.active_view:is(PluginView) and plugin_view.hovered_plugin and (plugin_view.hovered_plugin.status == "installed" or plugin_view.hovered_plugin.status == "orphan") + return core.active_view and core.active_view:is(PluginView) and plugin_view.hovered_plugin and (plugin_view.hovered_plugin.status == "installed" or plugin_view.hovered_plugin.status == "orphan" or plugin_view.hovered_plugin.status == "bundled") end, { ["plugin-manager:uninstall-hovered"] = function() plugin_view:uninstall(plugin_view.hovered_plugin) end, ["plugin-manager:reinstall-hovered"] = function() plugin_view:reinstall(plugin_view.hovered_plugin) end diff --git a/src/lpm.lua b/src/lpm.lua index e7ac06a..ef02c58 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -518,12 +518,13 @@ end function Plugin:get_install_path(bottle) local folder = self.type == "library" and "libraries" or "plugins" - local path = ((self:is_core(bottle) and bottle.lite_xl.datadir_path) or (bottle.local_path and (bottle.local_path .. PATHSEP .. "user") or USERDIR)) .. PATHSEP .. folder .. PATHSEP .. (self.path and common.basename(self.path):gsub("%.lua$", "") or self.name) + local path = (((self:is_core(bottle) or self:is_bundled()) and bottle.lite_xl.datadir_path) or (bottle.local_path and (bottle.local_path .. PATHSEP .. "user") or USERDIR)) .. PATHSEP .. folder .. PATHSEP .. (self.path and common.basename(self.path):gsub("%.lua$", "") or self.name) if self.organization == "singleton" then path = path .. ".lua" end return path end function Plugin:is_core(bottle) return self.type == "core" end +function Plugin:is_bundled(bottle) return self.type == "bundled" end function Plugin:is_installed(bottle) return self:is_core(bottle) or (bottle.lite_xl:is_compatible(self) and system.stat(self:get_install_path(bottle))) end function Plugin:is_incompatible(plugin) return self.dependencies[plugin.name] and not match_version(plugin.version, dependencies[plugin.name]) end @@ -978,7 +979,7 @@ function Bottle:all_plugins() local name = v:gsub("%.lua$", "") table.insert(t, Plugin.new(nil, { name = name, - type = i == 2 and "core", + type = i == 2 and (hash[name] and "bundled" or "core"), organization = (v:find("%.lua$") and "singleton" or "complex"), mod_version = self.lite_xl.mod_version, path = "plugins/" .. v, @@ -1254,17 +1255,18 @@ local function lpm_repo_list() end local function lpm_plugin_list(name) - local max_name = 0 + local max_name = 4 local result = { plugins = { } } for j,plugin in ipairs(common.grep(system_bottle:all_plugins(), function(p) return not name or p.name:find(name) end)) do max_name = math.max(max_name, #plugin.name) local repo = plugin.repository table.insert(result.plugins, { name = plugin.name, - status = plugin.repository and (plugin:is_installed(system_bottle) and "installed" or (system_bottle.lite_xl:is_compatible(plugin) and "available" or "incompatible")) or (plugin:is_core(system_bottle) and "core" or "orphan"), + status = plugin.repository and (plugin:is_installed(system_bottle) and "installed" or (system_bottle.lite_xl:is_compatible(plugin) and "available" or "incompatible")) or (plugin:is_bundled(system_bottle) and "bundled" or (plugin:is_core(system_bottle) and "core" or "orphan")), version = "" .. plugin.version, dependencies = plugin.dependencies, description = plugin.description, + author = plugin.author or (plugin:is_core(system_bottle) and "lite-xl"), mod_version = plugin.mod_version, tags = plugin.tags, type = plugin.type, @@ -1275,10 +1277,10 @@ local function lpm_plugin_list(name) end if JSON then io.stdout:write(json.encode(result) .. "\n") - else + elseif #result.plugins > 0 then if not VERBOSE then print(string.format("%" .. max_name .."s | %10s | %10s | %s", "Name", "Version", "ModVer", "Status")) - print(string.format("%" .. max_name .."s | %10s | %10s | %s", "--------------", "----------", "----------", "-----------")) + print(string.format("%" .. max_name .."s | %10s | %10s | %s", string.rep("-", max_name), "-------", "------", "-----------")) end for i, plugin in ipairs(common.sort(result.plugins, function(a,b) return a.name < b.name end)) do if VERBOSE then @@ -1286,6 +1288,7 @@ local function lpm_plugin_list(name) print("Name: " .. plugin.name) print("Version: " .. plugin.version) print("Status: " .. plugin.status) + print("Author: " .. (plugin.author or "")) print("Type: " .. plugin.type) print("Orgnization: " .. plugin.organization) print("Repository: " .. (plugin.repository or "orphan")) |