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