aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/session.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 11515de0..89ee042c 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -88,7 +88,12 @@ function M.load(filename)
elseif line:find('^current_view:') then
current_view = _VIEWS[tonumber(line:match('^current_view: (%d+)')) or 1]
elseif line:find('^recent:') then
- io.recent_files[#io.recent_files + 1] = line:match('^recent: (.+)$')
+ -- If a recent file is already open, do not add it to the list again.
+ local recent_file, exists = line:match('^recent: (.+)$'), false
+ for i = 1, #io.recent_files do
+ if io.recent_files[i] == recent_file then exists = true break end
+ end
+ if not exists then io.recent_files[#io.recent_files + 1] = recent_file end
end
end
f:close()