From nobody Mon Jul 11 09:27:55 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CBAB91CFDCD8; Mon, 11 Jul 2022 09:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LhJT759QCz3Gmw; Mon, 11 Jul 2022 09:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657531675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ndv4FYM3TrH4VDpOz3WO/ZAJENQwN+PHgA9SmPOsF/M=; b=pf9MVOnc+BYKHcwJfxdpJ3vemdK9CU5YxDkb7KD0tFfBMXcdAHfNvboKjb5zAah+9sWE1X zWFYmocbvgecNCOzdIIiR2NOQcZS8oxY958lpceHBp9G9r+EkBUSSFiy/QM+XjtbYxV4RC P2Hio5Vwj7JWweEDqaaP39cFpT5/+sumQTp0zkZvARrTd+5CCOu+sYLF65zdQ30LBFOYs/ iNciF+axP9+xi2XTKz2gU/1iGev/ej2r0nV9g5Li+NMQDiPYqqvacoUta8Y48bNbZ/ztlt SQMBP5rNkEdiAnxHwKpYwvfJxx93C2d280FGAb3NNBikNjx1a7QC0z5fOLq/Xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LhJT747Sxzygj; Mon, 11 Jul 2022 09:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26B9RtDe046806; Mon, 11 Jul 2022 09:27:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26B9Rtjo046805; Mon, 11 Jul 2022 09:27:55 GMT (envelope-from git) Date: Mon, 11 Jul 2022 09:27:55 GMT Message-Id: <202207110927.26B9Rtjo046805@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: 57777718bded - main - editors/lite: the port had been improved (part two) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57777718bded8d4b025863b893b6b9efc3b27753 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657531675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ndv4FYM3TrH4VDpOz3WO/ZAJENQwN+PHgA9SmPOsF/M=; b=BWz0kd1Y5l5+NOo1vz0z68hGiZiB13RM/F7WDEBXG+lJf0g4j02cqdvLriUtt59F5oiHqg EfyZ1R0Qsb6Yd/5/OETIcyiiu6c9XdW365rSSiZMjZ5ZCApDy20rhoJDUtdfLHgwhG4rDp CWLAitHaJlgl5zPBoUvsU2pWzafNzKXf/N8FsGwoXQQprlWMkp5WxzYfT1q6dUyCeb2lvn oYBlpQV/GAmglYZaFs/yKIfhvOSEVx+vbaUjzfkPR76upfanoEJEZTa499Or2u4rFUBn6k pdsTpUL/ECIKz+TNhcZ/zrDCS3QOxPEEeB2IP2UwQ7qDYfFdBXA7ArBwn1xQDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657531675; a=rsa-sha256; cv=none; b=oULld6TDJSKCCOYaHf3s7ZulW03ojU0+fJvau3tmieQTAyA5mlPIKoaWLR20ro4JAy4jxI +oL74uhZMxnSVUTdDx+pzigym8u4gNxxhz8V2FblbADoZO2E9OGaj+AtMc2nO+q/HIwzjW 5mnN+hL80I75fF/Yy4UM9DdUOzcsvNoOC/qVNI54BGa0tvvqB9407YOgi8AWQn8AdCsIMk epnOKpjFPOSYkGWZTayIQ3jAtYEHxQ6T0MQeAkPEZId98n5RzuLaKhWmI4fMPyG4RoxDNT 5Ze/VNCCFOP4uRjbplQs29PsOXJWGCYlsYaH1lvme6NkN439JiRuuGOj9l7Wxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=57777718bded8d4b025863b893b6b9efc3b27753 commit 57777718bded8d4b025863b893b6b9efc3b27753 Author: Alexey Dokuchaev AuthorDate: 2022-07-11 09:27:12 +0000 Commit: Alexey Dokuchaev CommitDate: 2022-07-11 09:27:12 +0000 editors/lite: the port had been improved (part two) - Install additional plugins, but abstain from automatically loading them all: unlike syntax highlight ones, some of them might change editor's behavior in potentially unwanted ways - Save the crash error log in the user's home directory --- editors/lite/Makefile | 2 ++ editors/lite/files/patch-data_core_init.lua | 26 +++++++++++++----- editors/lite/files/patch-src_main.c | 3 ++- editors/lite/pkg-plist | 42 +++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 7 deletions(-) diff --git a/editors/lite/Makefile b/editors/lite/Makefile index a8dd5403cbc2..4d989df3a935 100644 --- a/editors/lite/Makefile +++ b/editors/lite/Makefile @@ -45,6 +45,8 @@ do-install: ${CP} -a ${WRKSRC_colors}/colors ${STAGEDIR}${DATADIR}/user ${MV} ${WRKSRC_plugins}/plugins/language_*.lua \ ${STAGEDIR}${DATADIR}/plugins + ${CP} -a ${WRKSRC_plugins}/plugins \ + ${STAGEDIR}${DATADIR}/plugins/extra do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/editors/lite/files/patch-data_core_init.lua b/editors/lite/files/patch-data_core_init.lua index 7d13910080af..e0ec26783801 100644 --- a/editors/lite/files/patch-data_core_init.lua +++ b/editors/lite/files/patch-data_core_init.lua @@ -5,7 +5,7 @@ Doc = require "core.doc" - local project_dir = EXEDIR -+ local project_dir = os.getenv("HOME") or EXEDIR ++ local project_dir = HOMEDIR local files = {} for i = 2, #ARGS do local info = system.get_file_info(ARGS[i]) or {} @@ -29,21 +29,35 @@ .. string.format("%06x", temp_file_counter) .. (ext or "") end -@@ -174,7 +174,7 @@ function core.load_plugins() +@@ -174,16 +174,18 @@ function core.load_plugins() function core.load_plugins() local no_errors = true - local files = system.list_dir(EXEDIR .. "/data/plugins") +- for _, filename in ipairs(files) do +- local modname = "plugins." .. filename:gsub(".lua$", "") + local files = system.list_dir(DATADIR .. "/plugins") - for _, filename in ipairs(files) do - local modname = "plugins." .. filename:gsub(".lua$", "") ++ for _, filename in ipairs(files) do repeat ++ local luafile = filename:match("(.*)%.lua$") ++ if not luafile then break end ++ local modname = "plugins." .. luafile local ok = core.try(require, modname) -@@ -464,7 +464,7 @@ function core.on_error(err) + if ok then + core.log_quiet("Loaded plugin %q", modname) + else + no_errors = false + end +- end ++ until true end + return no_errors + end + +@@ -464,7 +466,7 @@ function core.on_error(err) function core.on_error(err) -- write error to file - local fp = io.open(EXEDIR .. "/error.txt", "wb") -+ local fp = io.open("/tmp/lite-error.txt", "wb") ++ local fp = io.open(HOMEDIR .. "/lite-error.txt", "wb") fp:write("Error: " .. tostring(err) .. "\n") fp:write(debug.traceback(nil, 4)) fp:close() diff --git a/editors/lite/files/patch-src_main.c b/editors/lite/files/patch-src_main.c index 1041196a88a6..bfb59f4a3b10 100644 --- a/editors/lite/files/patch-src_main.c +++ b/editors/lite/files/patch-src_main.c @@ -20,13 +20,14 @@ #else strcpy(buf, "./lite"); #endif -@@ -123,8 +129,9 @@ int main(int argc, char **argv) { +@@ -123,8 +129,10 @@ int main(int argc, char **argv) { " 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" + " DATADIR = '%%DATADIR%%'\n" ++ " HOMEDIR = os.getenv('HOME') or '/'\n" + " package.path = DATADIR .. '/?.lua;' .. package.path\n" + " package.path = DATADIR .. '/?/init.lua;' .. package.path\n" " core = require('core')\n" diff --git a/editors/lite/pkg-plist b/editors/lite/pkg-plist index e4b7eac16d10..fbfd3e40f992 100644 --- a/editors/lite/pkg-plist +++ b/editors/lite/pkg-plist @@ -29,6 +29,48 @@ bin/lite %%DATADIR%%/fonts/monospace.ttf %%DATADIR%%/plugins/autocomplete.lua %%DATADIR%%/plugins/autoreload.lua +%%DATADIR%%/plugins/extra/autoinsert.lua +%%DATADIR%%/plugins/extra/autowrap.lua +%%DATADIR%%/plugins/extra/bigclock.lua +%%DATADIR%%/plugins/extra/bracketmatch.lua +%%DATADIR%%/plugins/extra/centerdoc.lua +%%DATADIR%%/plugins/extra/closeconfirmx.lua +%%DATADIR%%/plugins/extra/colorpreview.lua +%%DATADIR%%/plugins/extra/copyfilelocation.lua +%%DATADIR%%/plugins/extra/datetimestamps.lua +%%DATADIR%%/plugins/extra/detectindent.lua +%%DATADIR%%/plugins/extra/dragdropselected.lua +%%DATADIR%%/plugins/extra/drawwhitespace.lua +%%DATADIR%%/plugins/extra/eval.lua +%%DATADIR%%/plugins/extra/exec.lua +%%DATADIR%%/plugins/extra/ghmarkdown.lua +%%DATADIR%%/plugins/extra/gitstatus.lua +%%DATADIR%%/plugins/extra/gofmt.lua +%%DATADIR%%/plugins/extra/hidelinenumbers.lua +%%DATADIR%%/plugins/extra/hidestatus.lua +%%DATADIR%%/plugins/extra/inanimate.lua +%%DATADIR%%/plugins/extra/indentguide.lua +%%DATADIR%%/plugins/extra/lastproject.lua +%%DATADIR%%/plugins/extra/lfautoinsert.lua +%%DATADIR%%/plugins/extra/linecopypaste.lua +%%DATADIR%%/plugins/extra/lineguide.lua +%%DATADIR%%/plugins/extra/macmodkeys.lua +%%DATADIR%%/plugins/extra/markers.lua +%%DATADIR%%/plugins/extra/motiontrail.lua +%%DATADIR%%/plugins/extra/openfilelocation.lua +%%DATADIR%%/plugins/extra/openselected.lua +%%DATADIR%%/plugins/extra/projectmanager.lua +%%DATADIR%%/plugins/extra/rainbowparen.lua +%%DATADIR%%/plugins/extra/scale.lua +%%DATADIR%%/plugins/extra/scalestatus.lua +%%DATADIR%%/plugins/extra/selectionhighlight.lua +%%DATADIR%%/plugins/extra/sort.lua +%%DATADIR%%/plugins/extra/spellcheck.lua +%%DATADIR%%/plugins/extra/tabnumbers.lua +%%DATADIR%%/plugins/extra/titleize.lua +%%DATADIR%%/plugins/extra/togglesnakecamel.lua +%%DATADIR%%/plugins/extra/unboundedscroll.lua +%%DATADIR%%/plugins/extra/workspace.lua %%DATADIR%%/plugins/language_angelscript.lua %%DATADIR%%/plugins/language_batch.lua %%DATADIR%%/plugins/language_c.lua