2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-20 20:43:23 +00:00

fix: dirs.push method not working (using undefined value)

This commit is contained in:
sammyette 2025-04-03 00:34:34 -04:00
parent 64dd52690d
commit 70378195ed
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -48,11 +48,11 @@ end
--- @param dir string
function dirs.push(dir)
dirs.recentDirs[dirs.recentSize + 1] = nil
if dirs.recentDirs[#dirs.recentDirs - 1] ~= d then
ok, d = pcall(fs.abs, d)
assert(ok, 'could not turn "' .. d .. '"into an absolute path')
if dirs.recentDirs[#dirs.recentDirs - 1] ~= dir then
local ok, dir = pcall(fs.abs, dir)
assert(ok, 'could not turn "' .. dir .. '"into an absolute path')
table.insert(dirs.recentDirs, 1, d)
table.insert(dirs.recentDirs, 1, dir)
end
end
@ -79,7 +79,6 @@ function dirs.setOld(d)
end
bait.catch('hilbish.cd', function(path, oldPath)
print(path, oldPath)
dirs.setOld(oldPath)
dirs.push(path)
end)