diff options
author | 2009-03-01 18:16:38 -0500 | |
---|---|---|
committer | 2009-03-01 18:16:38 -0500 | |
commit | 891bee0e40f31907e11333dadf7adf4b897250ee (patch) | |
tree | 5989e73850affd625f16c6185d7430f8798dd018 /core/file_io.lua | |
parent | 91ad8cd1c8843d3e2b996b2af1884c3b128bf0bb (diff) | |
download | textadept-891bee0e40f31907e11333dadf7adf4b897250ee.tar.gz textadept-891bee0e40f31907e11333dadf7adf4b897250ee.zip |
Ignore null byte for specific Scintilla messages; use buffer:get_text() again.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r-- | core/file_io.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 9ad6dffd..7649f1ed 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -169,7 +169,7 @@ function set_encoding(buffer, encoding) local iconv = textadept.iconv local pos = buffer.current_pos local first_visible_line = buffer.first_visible_line - local text = buffer:text_range(0, buffer.length) + local text = buffer:get_text(buffer.length) text = iconv(text, buffer.encoding, 'UTF-8') text = iconv(text, encoding, buffer.encoding) text = iconv(text, 'UTF-8', encoding) @@ -189,7 +189,7 @@ function save(buffer) textadept.check_focused_buffer(buffer) if not buffer.filename then return save_as(buffer) end textadept.events.handle('file_before_save', buffer.filename) - local text = buffer:text_range(0, buffer.length) + local text = buffer:get_text(buffer.length) if buffer.encoding then local bom = buffer.encoding_bom or '' text = bom..textadept.iconv(text, buffer.encoding, 'UTF-8') |