aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/file_io.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index 24c04926..3ba57fff 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -311,9 +311,15 @@ end)
-- @see recent_files
-- @name open_recent_file
function io.open_recent_file()
- local utf8_list = {}
- for i = 1, #io.recent_files do
- utf8_list[#utf8_list + 1] = io.recent_files[i]:iconv('UTF-8', _CHARSET)
+ local utf8_list, i = {}, 1
+ while i <= #io.recent_files do
+ local filename = io.recent_files[i]
+ if lfs.attributes(filename) then
+ utf8_list[#utf8_list + 1] = io.recent_files[i]:iconv('UTF-8', _CHARSET)
+ i = i + 1
+ else
+ table.remove(io.recent_files, i)
+ end
end
local button, i = ui.dialogs.filteredlist{
title = _L['Open File'], columns = _L['Filename'], items = utf8_list