aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2007-09-23 14:13:10 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2007-09-23 14:13:10 -0400
commita81e3dc27042481b6f401801d8f2c14004d5b879 (patch)
treec701fcec8de227d29edce83b075035b38224d1dd
parent80273cd17e8d0b39670c1618a98848a9540e071d (diff)
downloadtextadept-a81e3dc27042481b6f401801d8f2c14004d5b879.tar.gz
textadept-a81e3dc27042481b6f401801d8f2c14004d5b879.zip
Replaced l_handle_completion with overloaded l_handle_signal.
-rw-r--r--src/lua_interface.c7
-rw-r--r--src/textadept.c5
2 files changed, 3 insertions, 9 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 2029a1a8..221e4120 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -386,13 +386,6 @@ bool l_handle_keypress(int keyval, GdkEventKey *event) {
return l_call_function(4, 1);
}
-void l_handle_completion(const char *command) {
- if (!l_is_ta_table_function("events",
- command ? "show_completions" : "hide_completions")) return;
- if (command) lua_pushstring(lua, command);
- l_call_function(command ? 1 : 0);
-}
-
#define l_scn_int(i, n) { lua_pushinteger(lua, i); lua_setfield(lua, -2, n); }
#define l_scn_str(s, n) { lua_pushstring(lua, s); lua_setfield(lua, -2, n); }
diff --git a/src/textadept.c b/src/textadept.c
index 175ed783..ea60291e 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -229,11 +229,12 @@ static bool c_keypress(GtkWidget *widget, GdkEventKey *event, gpointer) {
if (event->state == 0)
switch(event->keyval) {
case 0xff1b:
- l_handle_completion(NULL);
+ l_handle_signal("hide_completions");
gtk_widget_grab_focus(focused_editor);
return true;
case 0xff09:
- l_handle_completion(gtk_entry_get_text(GTK_ENTRY(widget)));
+ l_handle_signal("show_completions",
+ gtk_entry_get_text(GTK_ENTRY(widget)));
return true;
}
else if (event->state == GDK_MOD1_MASK)