aboutsummaryrefslogtreecommitdiff
path: root/core/events.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-03-01 16:32:59 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-03-01 16:32:59 -0500
commit5919fc6b3a124f215c50bf1d187b37dad5a37858 (patch)
treee71e49a5b34f83945de48b0d255ea6c133ed3e63 /core/events.lua
parentc2c910627f6b8dc4bd638d2d83b3dcf83d92b857 (diff)
downloadtextadept-5919fc6b3a124f215c50bf1d187b37dad5a37858.tar.gz
textadept-5919fc6b3a124f215c50bf1d187b37dad5a37858.zip
Added support for multiple character encodings through g_convert().
Can open, save, and convert between different character encodings now.
Diffstat (limited to 'core/events.lua')
-rw-r--r--core/events.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/events.lua b/core/events.lua
index 6767ebac..67b4f813 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -399,12 +399,12 @@ add_handler('update_ui',
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count
local col = buffer.column[pos] + 1
local lexer = buffer:get_lexer_language()
- local mode = buffer.overtype and locale.STATUS_OVR or locale.STATUS_INS
local eol = EOLs[buffer.eol_mode + 1]
local tabs = (buffer.use_tabs and locale.STATUS_TABS or
locale.STATUS_SPACES)..buffer.indent
+ local enc = buffer.encoding or ''
textadept.docstatusbar_text =
- locale.DOCSTATUSBAR_TEXT:format(line, max, col, lexer, mode, eol, tabs)
+ locale.DOCSTATUSBAR_TEXT:format(line, max, col, lexer, eol, tabs, enc)
end)
add_handler('margin_click',
@@ -418,9 +418,11 @@ add_handler('buffer_new',
function() -- set additional buffer functions
local buffer = buffer
buffer.reload = textadept.io.reload
+ buffer.set_encoding = textadept.io.set_encoding
buffer.save = textadept.io.save
buffer.save_as = textadept.io.save_as
buffer.close = textadept.io.close
+ buffer.encoding = 'UTF-8'
set_title(buffer)
end)