aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-03-30 17:46:59 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-03-30 17:46:59 -0400
commitdfb2814ea4e84173251043d9d11020593f47fc6d (patch)
tree40965488c76c7b8a68a235c620554c0b9f94907a /src/textadept.c
parentd3abf22fe45db0a89b5e5833929ed7a6e281bbda (diff)
downloadtextadept-dfb2814ea4e84173251043d9d11020593f47fc6d.tar.gz
textadept-dfb2814ea4e84173251043d9d11020593f47fc6d.zip
Fixed Win32 curses issues.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c11
1 files changed, 4 insertions, 7 deletions
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);