From 70378195ed87c65ceed7c7c58e4cc75a5e4ab77d Mon Sep 17 00:00:00 2001 From: sammyette Date: Thu, 3 Apr 2025 00:34:34 -0400 Subject: [PATCH] fix: dirs.push method not working (using undefined value) --- nature/dirs.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nature/dirs.lua b/nature/dirs.lua index abb28df..db55954 100644 --- a/nature/dirs.lua +++ b/nature/dirs.lua @@ -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)