diff options
author | 2011-01-13 23:40:55 -0500 | |
---|---|---|
committer | 2011-01-13 23:40:55 -0500 | |
commit | 5b3d39a6ac36e344ae95666b6b60f3ee1d4e1057 (patch) | |
tree | 4ed61d5f00624d02932a5a4adbf79087e96935fd /src/textadept.c | |
parent | 238ea9f6743bcd6d76db40511396b676520263dd (diff) | |
download | textadept-5b3d39a6ac36e344ae95666b6b60f3ee1d4e1057.tar.gz textadept-5b3d39a6ac36e344ae95666b6b60f3ee1d4e1057.zip |
More informative check_focused_buffer() error message.
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/textadept.c b/src/textadept.c index 02146db8..4bb1eb13 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1402,7 +1402,7 @@ static long l_toscintillaparam(lua_State *lua, int type, int *arg_idx) { static void l_check_focused_buffer(lua_State *lua, int narg) { sptr_t cur_doc = SS(focused_editor, SCI_GETDOCPOINTER, 0, 0); luaL_argcheck(lua, cur_doc == l_checkdocpointer(lua, narg), 1, - "the indexed Buffer is not the focused one"); + "this buffer is not the current one"); } /******************************************************************************/ @@ -1572,6 +1572,7 @@ static int l_call_buffer_function(lua_State *lua) { int rt_type = l_rawgeti_int(lua, buffer_func_table_idx, 2); int p1_type = l_rawgeti_int(lua, buffer_func_table_idx, 3); int p2_type = l_rawgeti_int(lua, buffer_func_table_idx, 4); + l_check_focused_buffer(lua, 1); return l_call_scintilla(lua, editor, msg, p1_type, p2_type, rt_type, 2); } @@ -1590,7 +1591,6 @@ static int l_buffer_mt_index(lua_State *lua) { lua_getfield(lua, -1, key); lua_remove(lua, -2); // buffer functions if (lua_istable(lua, -1)) { - l_check_focused_buffer(lua, 1); // Of the form { msg, rt_type, p1_type, p2_type } lua_pushlightuserdata(lua, (GtkWidget *)focused_editor); lua_insert(lua, lua_gettop(lua) - 1); // shift buffer functions down |