aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/file_io.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index b87356f1..8ce76306 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -154,12 +154,14 @@ end
-- If any buffer is dirty, the user is prompted to continue. No buffers are
-- saved automatically. They must be saved manually.
-- @usage textadept.io.close_all()
+-- @return true if user did not cancel.
function close_all()
while #textadept.buffers > 1 do
view:goto_buffer(#textadept.buffers)
- if not buffer:close() then return end
+ if not buffer:close() then return false end
end
buffer:close() -- the last one
+ return true
end
---