summaryrefslogtreecommitdiff
path: root/src/gui_gtk.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-08-14 13:00:40 +0000
committerBram Moolenaar <Bram@vim.org>2007-08-14 13:00:40 +0000
commitd2c765e688426a98583d73f1e8b971cd5e37940b (patch)
treebe5a9d303eaed333383f67c9808e52f43bc75fdb /src/gui_gtk.c
parent67f7131efa985e51e2fe3f8be9524cc767f7d827 (diff)
downloadvim-git-d2c765e688426a98583d73f1e8b971cd5e37940b.tar.gz
updated for version 7.1-069v7.1.069
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r--src/gui_gtk.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index 094769d4b..cfba5c764 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -1630,11 +1630,14 @@ dlg_button_clicked(GtkWidget * widget, ButtonData *data)
*/
/*ARGSUSED*/
static int
-dlg_key_press_event(GtkWidget * widget, GdkEventKey * event, CancelData *data)
+dlg_key_press_event(GtkWidget *widget, GdkEventKey *event, CancelData *data)
{
- /* Ignore hitting Enter when there is no default button. */
- if (data->ignore_enter && event->keyval == GDK_Return)
+ /* Ignore hitting Enter (or Space) when there is no default button. */
+ if (data->ignore_enter && (event->keyval == GDK_Return
+ || event->keyval == ' '))
return TRUE;
+ else /* A different key was pressed, return to normal behavior */
+ data->ignore_enter = FALSE;
if (event->keyval != GDK_Escape && event->keyval != GDK_Return)
return FALSE;
@@ -2224,6 +2227,13 @@ dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
DialogInfo *di = (DialogInfo *)data;
+ /* Ignore hitting Enter (or Space) when there is no default button. */
+ if (di->ignore_enter && (event->keyval == GDK_Return
+ || event->keyval == ' '))
+ return TRUE;
+ else /* A different key was pressed, return to normal behavior */
+ di->ignore_enter = FALSE;
+
/* Close the dialog when hitting "Esc". */
if (event->keyval == GDK_Escape)
{