From 8793a733a6dd1f699ccfe4007c134493cca1f71d Mon Sep 17 00:00:00 2001 From: sammyette Date: Wed, 23 Apr 2025 19:31:11 -0400 Subject: [PATCH 1/3] chore: change ver info to 3.0 --- vars.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars.go b/vars.go index 86ed2532..84dbc0aa 100644 --- a/vars.go +++ b/vars.go @@ -11,8 +11,8 @@ var ( // Version info var ( - ver = "v2.4.0" - releaseName = "Moonflower" + ver = "v3.0.0" + releaseName = "Hyacinth" gitCommit string gitBranch string From 2ca99fe831fc9ad385e7c6a601834cdb7556479f Mon Sep 17 00:00:00 2001 From: sammyette Date: Wed, 23 Apr 2025 16:33:09 -0700 Subject: [PATCH 2/3] fix!: get/set env variables via env table (#294) this removes the old "virtual global table" which allows getting environment variables via just their names in lua. this means: an environment variable (like TERM) would need to be accessed via the `env` table instead of just using TERM in lua. `TERM` -> `env.TERM` they can also be set via `env.VARIABLE = 'value' --- nature/env.lua | 10 ++++++++++ nature/init.lua | 31 +------------------------------ 2 files changed, 11 insertions(+), 30 deletions(-) create mode 100644 nature/env.lua diff --git a/nature/env.lua b/nature/env.lua new file mode 100644 index 00000000..2d701283 --- /dev/null +++ b/nature/env.lua @@ -0,0 +1,10 @@ +env = {} + +setmetatable(env, { + __index = function(_, k) + return os.getenv(k) + end, + __newindex = function(_, k, v) + os.setenv(k, tostring(v)) + end +}) diff --git a/nature/init.lua b/nature/init.lua index cd4fd7a5..d8b2aa34 100644 --- a/nature/init.lua +++ b/nature/init.lua @@ -26,6 +26,7 @@ require 'nature.opts' require 'nature.vim' require 'nature.runner' require 'nature.hummingbird' +require 'nature.env' require 'nature.abbr' local shlvl = tonumber(os.getenv 'SHLVL') @@ -35,36 +36,6 @@ else os.setenv('SHLVL', '0') end -do - local virt_G = { } - - setmetatable(_G, { - __index = function (_, key) - local got_virt = virt_G[key] - if got_virt ~= nil then - return got_virt - end - - if type(key) == 'string' then - virt_G[key] = os.getenv(key) - end - return virt_G[key] - end, - - __newindex = function (_, key, value) - if type(value) == 'string' then - os.setenv(key, value) - virt_G[key] = value - else - if type(virt_G[key]) == 'string' then - os.setenv(key, '') - end - virt_G[key] = value - end - end, - }) -end - do local startSearchPath = hilbish.userDir.data .. '/hilbish/start/?/init.lua;' .. hilbish.userDir.data .. '/hilbish/start/?.lua' From 0854b5a76957b81212bfbb767ec3233de168a951 Mon Sep 17 00:00:00 2001 From: sammyette Date: Wed, 23 Apr 2025 19:36:50 -0400 Subject: [PATCH 3/3] fix!: don't define hilbish.completion, without the s at the end the interface is hilbish.completions (s at the end) --- api.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api.go b/api.go index 315884c8..bda0e0b3 100644 --- a/api.go +++ b/api.go @@ -101,7 +101,6 @@ func hilbishLoad(rtm *rt.Runtime) (rt.Value, func()) { // hilbish.completion table hshcomp := completionLoader(rtm) // TODO: REMOVE "completion" AND ONLY USE "completions" WITH AN S - mod.Set(rt.StringValue("completion"), rt.TableValue(hshcomp)) mod.Set(rt.StringValue("completions"), rt.TableValue(hshcomp)) // hilbish.runner table