From 891bee0e40f31907e11333dadf7adf4b897250ee Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 1 Mar 2009 18:16:38 -0500 Subject: Ignore null byte for specific Scintilla messages; use buffer:get_text() again. --- core/file_io.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/file_io.lua') 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') -- cgit v1.2.3