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
|
--- @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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user