diff options
author | 2009-02-28 20:55:22 -0500 | |
---|---|---|
committer | 2009-02-28 20:55:22 -0500 | |
commit | b1d103ecb28589d507477715f25fba5641d247c8 (patch) | |
tree | 2aff52d12db043853c2688added7c31e758460a1 /modules/lua/commands.lua | |
parent | 36aaa46d7f71e3efa26a7fdf66fac537c060f414 (diff) | |
download | textadept-b1d103ecb28589d507477715f25fba5641d247c8.tar.gz textadept-b1d103ecb28589d507477715f25fba5641d247c8.zip |
Use UTF-8 internally and respect platform filename encoding.
Added 'textadept.iconv' function to interface with GLib's g_convert() and set
global _CHARSET to be the platform's filename encoding/code page.
Diffstat (limited to 'modules/lua/commands.lua')
-rw-r--r-- | modules/lua/commands.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua index 47e872e0..8055f470 100644 --- a/modules/lua/commands.lua +++ b/modules/lua/commands.lua @@ -59,7 +59,7 @@ function goto_required() for path in package.path:gmatch('[^;]+') do path = path:gsub('?', file) if lfs.attributes(file) then - textadept.io.open(path) + textadept.io.open(textadept.iconv(path, 'UTF-8', _CHARSET)) break end end @@ -71,7 +71,9 @@ if type(keys) == 'table' then local m_editing = _m.textadept.editing keys.lua = { al = { - m = { textadept.io.open, _HOME..'/modules/lua/init.lua' }, + m = { textadept.io.open, + textadept.iconv(_HOME..'/modules/lua/init.lua', + 'UTF-8', _CHARSET) }, g = { goto_required }, }, ['s\n'] = { try_to_autocomplete_end }, |