diff options
-rw-r--r-- | core/ext/key_commands.lua | 3 | ||||
-rw-r--r-- | core/ext/key_commands_mac.lua | 4 | ||||
-rw-r--r-- | core/ext/key_commands_std.lua | 4 | ||||
-rw-r--r-- | core/ext/menu.lua | 2 | ||||
-rw-r--r-- | src/lua_interface.c | 11 |
5 files changed, 18 insertions, 6 deletions
diff --git a/core/ext/key_commands.lua b/core/ext/key_commands.lua index f9c108db..3bbbe1a2 100644 --- a/core/ext/key_commands.lua +++ b/core/ext/key_commands.lua @@ -7,7 +7,7 @@ module('textadept.key_commands', package.seeall) --[[ C: G - A: A C G J K L O Q W X Z + A: A C G J K L O W X Z CS: C D G J L Q R S T U W SA: A C D E G H I J K L M O Q R S T W X Z CA: A C G H J K L O Q S T V W X Y Z @@ -37,6 +37,7 @@ keys.co = { 'save', b } keys.cso = { 'save_as', b } keys.cx = { 'close', b } keys.csx = { t.io.close_all } +keys.aq = { t.quit } keys.cz = { 'undo', b } keys.csz = { 'redo', b } keys.cs = { t.find.focus } -- find/replace diff --git a/core/ext/key_commands_mac.lua b/core/ext/key_commands_mac.lua index 811b37eb..6abd9e0f 100644 --- a/core/ext/key_commands_mac.lua +++ b/core/ext/key_commands_mac.lua @@ -8,7 +8,7 @@ module('textadept.key_commands_mac', package.seeall) --[[ C: J L R U W X Z - A: B D E H J K L Q U + A: B D E H J K L U CS: C D G H I J K L M O Q R S T U V W X Y Z SA: A B C D F H J K L M N O Q R T U V X CA: A C E G J K L M N O Q R S T U V W X Y Z @@ -39,7 +39,7 @@ keys.aw = { 'close', b } keys.saw = { t.io.close_all } -- TODO: { t.io.load_session } after prompting with open dialog -- TODO: { t.io.save_session } after prompting with save dialog --- TODO: quit +keys.aq = { t.quit } -- Edit local m_editing = _m.textadept.editing diff --git a/core/ext/key_commands_std.lua b/core/ext/key_commands_std.lua index cd93877a..e924609a 100644 --- a/core/ext/key_commands_std.lua +++ b/core/ext/key_commands_std.lua @@ -8,7 +8,7 @@ module('textadept.key_commands_std', package.seeall) --[[ C: B D H J K L R U - A: A B C D E F G H J K L M N P Q R S T U V W X Y Z + A: A B C D E F G H J K L M N P R S T U V W X Y Z CS: A B C D F G H J K L M N O Q R T U V X Y Z SA: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z CA: A B C D E F G H J K L M N O Q R S T U V W X Y Z @@ -39,7 +39,7 @@ keys.cw = { 'close', b } keys.csw = { t.io.close_all } -- TODO: { t.io.load_session } after prompting with open dialog -- TODO: { t.io.save_session } after prompting with save dialog --- TODO: quit +keys.aq = { t.quit } -- Edit local m_editing = _m.textadept.editing diff --git a/core/ext/menu.lua b/core/ext/menu.lua index 913155fb..2b3209e6 100644 --- a/core/ext/menu.lua +++ b/core/ext/menu.lua @@ -192,7 +192,7 @@ local actions = { ['Close All'] = { t.io.close_all }, ['Load Session...'] = { t.io.load_session }, -- TODO: file open dialog prompt ['Save Session...'] = { t.io.save_session }, -- TODO: file save dialog prompt - Quit = { }, -- TODO: + Quit = { t.quit }, -- Edit Undo = { 'undo', b }, Redo = { 'redo', b }, diff --git a/src/lua_interface.c b/src/lua_interface.c index 30dcc98f..3baef912 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -50,6 +50,7 @@ LF l_cf_ta_buffer_new(LS *lua), l_cf_ta_gtkmenu(LS *lua), l_cf_ta_popupmenu(LS *lua), l_cf_ta_reset(LS *lua), + l_cf_ta_quit(LS *lua), l_cf_pm_focus(LS *lua), l_cf_pm_clear(LS *lua), l_cf_pm_activate(LS *lua), l_cf_find_focus(LS *lua), l_cf_call_find_next(LS *lua), l_cf_call_find_prev(LS *lua), @@ -116,6 +117,7 @@ bool l_init(int argc, char **argv, bool reinit) { l_cfunc(lua, l_cf_ta_gtkmenu, "gtkmenu"); l_cfunc(lua, l_cf_ta_popupmenu, "popupmenu"); l_cfunc(lua, l_cf_ta_reset, "reset"); + l_cfunc(lua, l_cf_ta_quit, "quit"); l_mt(lua, "_textadept_mt", l_ta_mt_index, l_ta_mt_newindex); lua_setglobal(lua, "textadept"); @@ -1403,6 +1405,15 @@ LF l_cf_ta_reset(LS *lua) { return 0; } +LF l_cf_ta_quit(LS *) { + GdkEventAny event; + event.type = GDK_DELETE; + event.window = window->window; + event.send_event = TRUE; + gdk_event_put(reinterpret_cast<GdkEvent*>(&event)); + return 0; +} + LF l_cf_pm_focus(LS *) { pm_toggle_focus(); return 0; |