From 5e9ea9fead520b0c412ee1d53e4affd44a68a0e9 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:16:16 -0400 Subject: [PATCH] fix: dont add recent dir if its same as last previous (fixes #92) --- preload.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/preload.lua b/preload.lua index 0d42ba7..3a6148a 100644 --- a/preload.lua +++ b/preload.lua @@ -30,8 +30,10 @@ commander.register('cd', function (args) bait.throw('cd', path) -- add to table of recent dirs - table.insert(recentDirs, 1, path) recentDirs[11] = nil + if recentDirs[#recentDirs - 1] ~= path then + table.insert(recentDirs, 1, path) + end return end