From 9b9bef5f2d640eaf6deaca3ab93ccda49a39e790 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 28 Jul 2020 22:01:33 -0400 Subject: Updated for 11.0 alpha 3. --- src/Info.plist | 4 ++-- src/textadept.c | 15 +++++++++++++++ src/textadept.rc | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Info.plist b/src/Info.plist index 9fc1959c..f6202e47 100644 --- a/src/Info.plist +++ b/src/Info.plist @@ -2304,9 +2304,9 @@ CFBundleSignature ???? CFBundleVersion - 11.0alpha2 + 11.0alpha3 CFBundleShortVersionString - 11.0 alpha 2 + 11.0 alpha 3 NSHighResolutionCapable diff --git a/src/textadept.c b/src/textadept.c index 104492e1..26c0002e 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -806,6 +806,20 @@ static int menu(lua_State *L) { #endif } +/** `ui.update()` Lua function. */ +static int update_ui(lua_State *L) { +#if GTK + while (gtk_events_pending()) gtk_main_iteration(); +#elif (CURSES && !_WIN32) + struct timeval timeout = {0, 1e5}; // 0.1s + int nfds = os_spawn_pushfds(L); + while (select(nfds, lua_touserdata(L, -1), NULL, NULL, &timeout) > 0) + if (os_spawn_readfds(L) >= 0) refresh_all(); + lua_pop(L, 1); // fd_set +#endif + return 0; +} + /** `ui.__index` Lua metamethod. */ static int ui_index(lua_State *L) { const char *key = lua_tostring(L, 2); @@ -1560,6 +1574,7 @@ static bool init_lua(lua_State *L, int argc, char **argv, bool reinit) { lua_pushcfunction(L, get_split_table), lua_setfield(L, -2, "get_split_table"); lua_pushcfunction(L, goto_view), lua_setfield(L, -2, "goto_view"); lua_pushcfunction(L, menu), lua_setfield(L, -2, "menu"); + lua_pushcfunction(L, update_ui), lua_setfield(L, -2, "update"); set_metatable(L, -1, "ta_ui", ui_index, ui_newindex); lua_setglobal(L, "ui"); diff --git a/src/textadept.rc b/src/textadept.rc index d74068a4..24eedaa7 100644 --- a/src/textadept.rc +++ b/src/textadept.rc @@ -17,12 +17,12 @@ BEGIN BEGIN VALUE "CompanyName", "Mitchell\0" VALUE "FileDescription", "textadept\0" - VALUE "FileVersion", "11.0 alpha 2\0" + VALUE "FileVersion", "11.0 alpha 3\0" VALUE "InternalName", "textadept\0" VALUE "LegalCopyright", "Copyright 2006-2020 by Mitchell\0" VALUE "OriginalFilename", "textadept.exe\0" VALUE "ProductName", "textadept\0" - VALUE "ProductVersion", "11.0 alpha 2\0" + VALUE "ProductVersion", "11.0 alpha 3\0" END END END -- cgit v1.2.3