diff options
author | 2020-12-22 09:27:01 -0500 | |
---|---|---|
committer | 2020-12-22 09:27:01 -0500 | |
commit | fff7d603bf349f519742bce84b46fb4bc84b8fef (patch) | |
tree | d5322766ae9f1aee054cc1abf661c6d99939ba29 /core/file_io.lua | |
parent | f107c48f8fbc4ef27b2bb1d4d01420229421b885 (diff) | |
download | textadept-fff7d603bf349f519742bce84b46fb4bc84b8fef.tar.gz textadept-fff7d603bf349f519742bce84b46fb4bc84b8fef.zip |
Fixed `buffer:reload()` only reloading up to a NUL byte, if present.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r-- | core/file_io.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 3ba57fff..f02043b5 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -162,7 +162,8 @@ local function reload(buffer) local text = f:read('a') f:close() if buffer.encoding then text = text:iconv('UTF-8', buffer.encoding) end - buffer:set_text(text) + buffer:clear_all() + buffer:append_text(text) buffer:set_save_point() buffer.mod_time = lfs.attributes(buffer.filename, 'modification') if buffer == _G.buffer then events.emit(events.FILE_AFTER_RELOAD) end |