From dfb2814ea4e84173251043d9d11020593f47fc6d Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 30 Mar 2020 17:46:59 -0400 Subject: Fixed Win32 curses issues. --- src/textadept.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/textadept.c b/src/textadept.c index 33d2f2ab..59794441 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -596,9 +596,6 @@ static int dialog(lua_State *L) { char *out = gtdialog(type, argc, argv); lua_pushstring(L, out); free(out); -#if (CURSES && _WIN32) - redrawwin(scintilla_get_window(focused_view)); // needed for pdcurses -#endif return 1; } @@ -2448,6 +2445,10 @@ static TermKeyResult textadept_waitkey(TermKey *tk, TermKeyKey *key) { lua_pop(lua, 1); // fd_set } #else + // TODO: ideally computation of view would not be done twice. + Scintilla *view = !command_entry_focused ? focused_view : command_entry; + termkey_set_fd(ta_tk, scintilla_get_window(view)); + mouse_set(ALL_MOUSE_EVENTS); // _popen() and system() change console mode return termkey_getkey(tk, key); #endif } @@ -2626,10 +2627,6 @@ int main(int argc, char **argv) { } refresh_all(); view = !command_entry_focused ? focused_view : command_entry; -#if _WIN32 - termkey_set_fd(ta_tk, scintilla_get_window(view)); - mouse_set(ALL_MOUSE_EVENTS); // _popen() and system() change console mode -#endif } endwin(); termkey_destroy(ta_tk); -- cgit v1.2.3