aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua_interface.c14
-rw-r--r--src/textadept.c10
-rw-r--r--src/textadept.h5
3 files changed, 14 insertions, 15 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 221e4120..609c6602 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -159,7 +159,7 @@ void l_goto_scintilla_window(GtkWidget *editor, int n, bool absolute) {
} else lua_rawgeti(lua, -1, n);
editor = l_checkview(lua, -1, "No view exists at that index.");
gtk_widget_grab_focus(editor);
- if (!closing) l_handle_signal("view_switch");
+ if (!closing) l_handle_event("view_switch");
lua_pop(lua, 2); // view table and views
}
@@ -274,7 +274,7 @@ void l_goto_scintilla_buffer(GtkWidget *editor, int n, bool absolute) {
SS(sci, SCI_VISIBLEFROMDOCLINE, lua_tointeger(lua, -1)) -
SS(sci, SCI_GETFIRSTVISIBLELINE));
lua_pop(lua, 4); // _anchor, _current_pos, _first_visible_line, and buffer
- if (!closing) l_handle_signal("buffer_switch");
+ if (!closing) l_handle_event("buffer_switch");
lua_pop(lua, 2); // buffer table and buffers
}
@@ -367,11 +367,11 @@ void l_handle_error(LS *lua, const char *errmsg) {
lua_settop(lua, 0);
}
-bool l_handle_signal(const char *s) {
+bool l_handle_event(const char *s) {
return l_is_ta_table_function("events", s) ? l_call_function(0, 1) : true;
}
-bool l_handle_signal(const char *s, const char *arg) {
+bool l_handle_event(const char *s, const char *arg) {
if (!l_is_ta_table_function("events", s)) return false;
lua_pushstring(lua, arg);
return l_call_function(1, 1);
@@ -420,7 +420,7 @@ void l_handle_scnnotification(SCNotification *n) {
void l_ta_command(const char *command) {
int top = lua_gettop(lua);
if (luaL_dostring(lua, command) == 0) {
- l_handle_signal("update_ui");
+ l_handle_event("update_ui");
lua_settop(lua, top);
} else l_handle_error(lua, "Error executing command.");
}
@@ -842,7 +842,7 @@ LF l_cf_buffer_delete(LS *lua) {
else
new_scintilla_buffer(SCINTILLA(focused_editor), true, true);
remove_scintilla_buffer(doc);
- l_handle_signal("buffer_deleted");
+ l_handle_event("buffer_deleted");
return 0;
}
@@ -977,7 +977,7 @@ LF l_cf_find_focus(LS *) { find_toggle_focus(); return 0; }
static void t_menu_activate(GtkWidget *menu_item, gpointer) {
GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu_item));
const char *text = gtk_label_get_text(GTK_LABEL(label));
- l_handle_signal("menu_clicked", text);
+ l_handle_event("menu_clicked", text);
}
LF l_cf_gtkmenu(LS *lua) {
diff --git a/src/textadept.c b/src/textadept.c
index ea60291e..220986be 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -78,7 +78,7 @@ GtkWidget* new_scintilla_window(sptr_t buffer_id) {
new_scintilla_buffer(SCINTILLA(editor), false, false);
} else new_scintilla_buffer(SCINTILLA(editor), false, true);
l_set_view_global(editor);
- l_handle_signal("view_new");
+ l_handle_event("view_new");
return editor;
}
@@ -105,7 +105,7 @@ void new_scintilla_buffer(ScintillaObject *sci, bool create, bool addref) {
SS(sci, SCI_STYLESETBACK, 32, 0x33 | (0x33 << 8) | (0x33 << 16));
set_default_buffer_properties(sci);
l_set_buffer_global(sci);
- l_handle_signal("buffer_new");
+ l_handle_event("buffer_new");
}
void remove_scintilla_buffer(sptr_t doc) {
@@ -229,11 +229,11 @@ static bool c_keypress(GtkWidget *widget, GdkEventKey *event, gpointer) {
if (event->state == 0)
switch(event->keyval) {
case 0xff1b:
- l_handle_signal("hide_completions");
+ l_handle_event("hide_completions");
gtk_widget_grab_focus(focused_editor);
return true;
case 0xff09:
- l_handle_signal("show_completions",
+ l_handle_event("show_completions",
gtk_entry_get_text(GTK_ENTRY(widget)));
return true;
}
@@ -277,7 +277,7 @@ static bool w_keypress(GtkWidget*, GdkEventKey *event, gpointer) {
}
static bool w_exit(GtkWidget*, GdkEventAny*, gpointer) {
- if (!l_handle_signal("quit")) return true;
+ if (!l_handle_event("quit")) return true;
l_close();
scintilla_release_resources();
gtk_main_quit();
diff --git a/src/textadept.h b/src/textadept.h
index f34c2655..5f9b62c1 100644
--- a/src/textadept.h
+++ b/src/textadept.h
@@ -66,10 +66,9 @@ void l_goto_scintilla_buffer(GtkWidget *editor, int n, bool absolute=true);
void l_set_buffer_global(ScintillaObject *sci);
void l_handle_error(lua_State *lua, const char *errmsg=0);
-bool l_handle_signal(const char *s);
-bool l_handle_signal(const char *s, const char *arg);
+bool l_handle_event(const char *e);
+bool l_handle_event(const char *e, const char *arg);
bool l_handle_keypress(int keyval, GdkEventKey *event);
-void l_handle_completion(const char *command);
void l_handle_scnnotification(SCNotification *n);
void l_ta_command(const char *command);