From d6eb8cb3d6a968de8525633aa5cc8c304fdd6844 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 19 Jan 2012 23:30:15 -0500 Subject: Fixed bug with recent files; modules/textadept/session.lua --- modules/textadept/session.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index 04566a2e..59d0814b 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -78,11 +78,14 @@ function M.load(filename) if width and height then gui.size = { width, height } end elseif line:find('^recent:') then local filename = line:match('^recent: (.+)$') - local recent = io.recent_files + local recent, exists = io.recent_files, false for i, file in ipairs(recent) do - if filename == file then break end - if i == #recent then recent[#recent + 1] = filename end + if filename == file then + exists = true + break + end end + if not exists then recent[#recent + 1] = filename end end end f:close() -- cgit v1.2.3