astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
f72909d
To: vim-dev@vim.org
f72909d
Subject: patch 7.1.069
f72909d
Fcc: outbox
f72909d
From: Bram Moolenaar <Bram@moolenaar.net>
f72909d
Mime-Version: 1.0
f72909d
Content-Type: text/plain; charset=ISO-8859-1
f72909d
Content-Transfer-Encoding: 8bit
f72909d
------------
f72909d
f72909d
Patch 7.1.069
f72909d
Problem:    GTK GUI: When using confirm() without a default button there still
f72909d
	    is a default choice.
f72909d
Solution:   Ignore Enter and Space when there is no default button. (Chris
f72909d
	    Lubinski)
f72909d
Files:	    src/gui_gtk.c
f72909d
f72909d
f72909d
*** ../vim-7.1.068/src/gui_gtk.c	Mon May 14 19:35:51 2007
f72909d
--- src/gui_gtk.c	Sat Aug 11 17:38:03 2007
f72909d
***************
f72909d
*** 1630,1640 ****
f72909d
   */
f72909d
  /*ARGSUSED*/
f72909d
      static int
f72909d
! dlg_key_press_event(GtkWidget * widget, GdkEventKey * event, CancelData *data)
f72909d
  {
f72909d
!     /* Ignore hitting Enter when there is no default button. */
f72909d
!     if (data->ignore_enter && event->keyval == GDK_Return)
f72909d
  	return TRUE;
f72909d
  
f72909d
      if (event->keyval != GDK_Escape && event->keyval != GDK_Return)
f72909d
  	return FALSE;
f72909d
--- 1630,1643 ----
f72909d
   */
f72909d
  /*ARGSUSED*/
f72909d
      static int
f72909d
! dlg_key_press_event(GtkWidget *widget, GdkEventKey *event, CancelData *data)
f72909d
  {
f72909d
!     /* Ignore hitting Enter (or Space) when there is no default button. */
f72909d
!     if (data->ignore_enter && (event->keyval == GDK_Return
f72909d
! 						     || event->keyval == ' '))
f72909d
  	return TRUE;
f72909d
+     else    /* A different key was pressed, return to normal behavior */
f72909d
+ 	data->ignore_enter = FALSE;
f72909d
  
f72909d
      if (event->keyval != GDK_Escape && event->keyval != GDK_Return)
f72909d
  	return FALSE;
f72909d
***************
f72909d
*** 2223,2228 ****
f72909d
--- 2226,2238 ----
f72909d
  dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
f72909d
  {
f72909d
      DialogInfo *di = (DialogInfo *)data;
f72909d
+ 
f72909d
+     /* Ignore hitting Enter (or Space) when there is no default button. */
f72909d
+     if (di->ignore_enter && (event->keyval == GDK_Return
f72909d
+ 						     || event->keyval == ' '))
f72909d
+ 	return TRUE;
f72909d
+     else    /* A different key was pressed, return to normal behavior */
f72909d
+ 	di->ignore_enter = FALSE;
f72909d
  
f72909d
      /* Close the dialog when hitting "Esc". */
f72909d
      if (event->keyval == GDK_Escape)
f72909d
*** ../vim-7.1.068/src/version.c	Sun Aug 12 16:55:01 2007
f72909d
--- src/version.c	Tue Aug 14 14:58:36 2007
f72909d
***************
f72909d
*** 668,669 ****
f72909d
--- 668,671 ----
f72909d
  {   /* Add new patch number below this line */
f72909d
+ /**/
f72909d
+     69,
f72909d
  /**/
f72909d
f72909d
-- 
f72909d
hundred-and-one symptoms of being an internet addict:
f72909d
148. You find it easier to dial-up the National Weather Service
f72909d
     Weather/your_town/now.html than to simply look out the window.
f72909d
f72909d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
f72909d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
f72909d
\\\        download, build and distribute -- http://www.A-A-P.org        ///
f72909d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///