diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2017-06-23 00:07:54 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2017-06-23 00:07:54 -0400 |
commit | f5aabd9def417094b478ef34acd1d89341670e3f (patch) | |
tree | 183d74bd1c3fe249776619d9519198a7836d1283 /core/file_io.lua | |
parent | 823d2770fe7ea7e8269ea43119d98f3f9130611e (diff) |
Small code cleanup.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r-- | core/file_io.lua | 3 |
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 |