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.lua4
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')