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:
parent
64dd52690d
commit
70378195ed
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user