aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index 48568081..bb267bcb 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -206,8 +206,7 @@ function io.save_file()
local text = buffer:get_text()
if buffer.encoding then text = text:iconv(buffer.encoding, 'UTF-8') end
local f = assert(io.open(buffer.filename, 'wb'))
- f:write(text)
- f:close()
+ f:write(text):close()
buffer:set_save_point()
buffer.mod_time = lfs.attributes(buffer.filename, 'modification')
if buffer._type then buffer._type = nil end