mirror of
https://github.com/Hilbis/Hilbish
synced 2025-05-12 15:23:23 +00:00
Compare commits
3 Commits
527e0e0abc
...
d9fb82d11d
Author | SHA1 | Date | |
---|---|---|---|
d9fb82d11d | |||
|
36ce05e85a | ||
a24bca3258 |
@ -1,5 +1,9 @@
|
|||||||
# 🎀 Changelog
|
# 🎀 Changelog
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
### Fixed
|
||||||
|
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
|
||||||
|
|
||||||
## [2.3.3] - 2024-11-04
|
## [2.3.3] - 2024-11-04
|
||||||
### Fixed
|
### Fixed
|
||||||
- Heredocs having issues
|
- Heredocs having issues
|
||||||
|
@ -157,9 +157,12 @@ func matchPath(query string) ([]string, string) {
|
|||||||
|
|
||||||
files, _ := os.ReadDir(path)
|
files, _ := os.ReadDir(path)
|
||||||
for _, entry := range files {
|
for _, entry := range files {
|
||||||
// should we handle errors here?
|
|
||||||
file, err := entry.Info()
|
file, err := entry.Info()
|
||||||
if err == nil && file.Mode() & os.ModeSymlink != 0 {
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if file.Mode() & os.ModeSymlink != 0 {
|
||||||
path, err := filepath.EvalSymlinks(filepath.Join(path, file.Name()))
|
path, err := filepath.EvalSymlinks(filepath.Join(path, file.Name()))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
file, err = os.Lstat(path)
|
file, err = os.Lstat(path)
|
||||||
|
10
nature/env.lua
Normal file
10
nature/env.lua
Normal file
@ -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
|
||||||
|
})
|
@ -24,6 +24,7 @@ require 'nature.opts'
|
|||||||
require 'nature.vim'
|
require 'nature.vim'
|
||||||
require 'nature.runner'
|
require 'nature.runner'
|
||||||
require 'nature.hummingbird'
|
require 'nature.hummingbird'
|
||||||
|
require 'nature.env'
|
||||||
|
|
||||||
local shlvl = tonumber(os.getenv 'SHLVL')
|
local shlvl = tonumber(os.getenv 'SHLVL')
|
||||||
if shlvl ~= nil then
|
if shlvl ~= nil then
|
||||||
@ -32,36 +33,6 @@ else
|
|||||||
os.setenv('SHLVL', '0')
|
os.setenv('SHLVL', '0')
|
||||||
end
|
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
|
do
|
||||||
local startSearchPath = hilbish.userDir.data .. '/hilbish/start/?/init.lua;'
|
local startSearchPath = hilbish.userDir.data .. '/hilbish/start/?/init.lua;'
|
||||||
.. hilbish.userDir.data .. '/hilbish/start/?.lua'
|
.. hilbish.userDir.data .. '/hilbish/start/?.lua'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user