aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-10-04 17:11:15 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-10-04 17:11:15 -0400
commit22ff86dc902db37bff2d6d0cc330403506c7b85e (patch)
tree3187363d768ee81d698d18ec0aaf42bac9b5cb17 /src/textadept.c
parent0abd95dbaf5a9970170cf237cc141f2bb4031abb (diff)
downloadtextadept-22ff86dc902db37bff2d6d0cc330403506c7b85e.tar.gz
textadept-22ff86dc902db37bff2d6d0cc330403506c7b85e.zip
Flush input queue in ncurses when finished with CDK widgets; src/textadept.c
Otherwise, if 'Esc' is pressed twice rapidly, it is stored in the queue.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/textadept.c b/src/textadept.c
index fcc6eb54..618dedce 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -62,6 +62,7 @@ typedef GtkWidget Scintilla;
#define SS(view, m, w, l) scintilla_send_message(view, m, w, l)
#define focus_view(v) \
SS(focused_view, SCI_SETFOCUS, 0, 0), SS(v, SCI_SETFOCUS, 1, 0)
+#define flushch() timeout(0), getch(), timeout(-1)
static struct termios term;
#endif
@@ -431,7 +432,7 @@ static int lfind_focus(lua_State *L) {
free(clipboard), free(GPasteBuffer), GPasteBuffer = NULL;
destroyCDKEntry(find_entry), destroyCDKEntry(replace_entry);
destroyCDKButtonbox(buttonbox), destroyCDKButtonbox(optionbox);
- delwin(findbox->window), destroyCDKScreen(findbox), findbox = NULL;
+ delwin(findbox->window), destroyCDKScreen(findbox), findbox = NULL, flushch();
wresize(scintilla_get_window(focused_view), LINES - 2, COLS);
#endif
return 0;
@@ -585,7 +586,7 @@ static int lce_focus(lua_State *L) {
if (strcmp(clipboard, GPasteBuffer)) set_clipboard(GPasteBuffer);
free(clipboard), free(GPasteBuffer), GPasteBuffer = NULL;
destroyCDKEntry(command_entry), command_entry = NULL;
- delwin(screen->window), destroyCDKScreen(screen);
+ delwin(screen->window), destroyCDKScreen(screen), flushch();
#endif
return 0;
}
@@ -639,7 +640,7 @@ static int lce_show_completions(lua_State *L) {
}
curs_set(1);
destroyCDKScroll(scrolled);
- delwin(screen->window), destroyCDKScreen(screen);
+ delwin(screen->window), destroyCDKScreen(screen), flushch();
free(items);
drawCDKEntry(command_entry, FALSE);
#endif