aboutsummaryrefslogtreecommitdiff
path: root/modules/cpp
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-28 20:55:22 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-28 20:55:22 -0500
commitb1d103ecb28589d507477715f25fba5641d247c8 (patch)
tree2aff52d12db043853c2688added7c31e758460a1 /modules/cpp
parent36aaa46d7f71e3efa26a7fdf66fac537c060f414 (diff)
downloadtextadept-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/cpp')
-rw-r--r--modules/cpp/commands.lua4
-rw-r--r--modules/cpp/snippets.lua2
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/cpp/commands.lua b/modules/cpp/commands.lua
index d1e2fd17..65c3f8af 100644
--- a/modules/cpp/commands.lua
+++ b/modules/cpp/commands.lua
@@ -12,7 +12,9 @@ if type(keys) == 'table' then
local m_editing = _m.textadept.editing
keys.cpp = {
al = {
- m = { textadept.io.open, _HOME..'/modules/cpp/init.lua' },
+ m = { textadept.io.open,
+ textadept.iconv(_HOME..'/modules/cpp/init.lua',
+ 'UTF-8', _CHARSET) },
},
['s\n'] = { function()
buffer:line_end()
diff --git a/modules/cpp/snippets.lua b/modules/cpp/snippets.lua
index 4f2c5833..8a4e0291 100644
--- a/modules/cpp/snippets.lua
+++ b/modules/cpp/snippets.lua
@@ -49,7 +49,7 @@ if type(snippets) == 'table' then
lrsi = 'lua_rawseti(%1(lua), %2(-2), %3(1));',
lr = 'lua_register(%1(lua), %2(fname), %3(cfunction));',
lsf = 'lua_setfield(%1(lua), %2(-2), %3(field));',
- lsg = 'lua_setglobal(%1(lua), %2(-2), %3(global));',
+ lsg = 'lua_setglobal(%1(lua), %2(global));',
lst = 'lua_settable(%1(lua), %2(-3));',
ltb = 'lua_toboolean(%1(lua), %2(-1))',
ltcf = 'lua_tocfunction(%1(lua), %2(-1))',