To: [email protected]
Subject: Patch 6.1b.011
Fcc: outbox
From: Bram Moolenaar <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.1b.011
Problem:    When using a very long string for confirm(), can't quit the
           displaying at the more prompt. (Hari Krishna Dara)
Solution:   Jump to the end of the message to show the choices.
Files:      src/message.c


*** ../vim61b.010/src/message.c Tue Mar 12 22:31:40 2002
--- src/message.c       Thu Mar 14 21:11:44 2002
***************
*** 31,37 ****
 static void redir_write __ARGS((char_u *s));
 #ifdef FEAT_CON_DIALOG
 static char_u *msg_show_console_dialog __ARGS((char_u *message, char_u *buttons, int dfltbutton));
! static int msg_noquit_more = FALSE; /* quit not allowed at more prompt */
 #endif

 struct msg_hist
--- 31,39 ----
 static void redir_write __ARGS((char_u *s));
 #ifdef FEAT_CON_DIALOG
 static char_u *msg_show_console_dialog __ARGS((char_u *message, char_u *buttons, int dfltbutton));
! static int    confirm_msg_used = FALSE;       /* displaying confirm_msg */
! static char_u *confirm_msg = NULL;            /* ":confirm" message */
! static char_u *confirm_msg_tail;              /* tail of confirm_msg */
 #endif

 struct msg_hist
***************
*** 1686,1707 ****
                       lines_left = 1;
                       break;
                   case ':':           /* start new command line */
!                       /* Since got_int is set all typeahead will be flushed,
!                        * but we want to keep this ':', remember that in a
!                        * special way. */
!                       typeahead_noflush(':');
!                       cmdline_row = Rows - 1;   /* put ':' on this line */
!                       skip_redraw = TRUE;       /* skip redraw once */
!                       need_wait_return = FALSE; /* don't wait in main() */
                       /*FALLTHROUGH*/
                   case 'q':           /* quit */
                   case Ctrl_C:
                   case ESC:
 #ifdef FEAT_CON_DIALOG
!                       if (msg_noquit_more)
                       {
!                           /* When quitting is not possible, behave like
!                            * another page can be printed */
                           lines_left = Rows - 1;
                       }
                       else
--- 1688,1714 ----
                       lines_left = 1;
                       break;
                   case ':':           /* start new command line */
! #ifdef FEAT_CON_DIALOG
!                       if (!confirm_msg_used)
! #endif
!                       {
!                           /* Since got_int is set all typeahead will be
!                            * flushed, but we want to keep this ':', remember
!                            * that in a special way. */
!                           typeahead_noflush(':');
!                           cmdline_row = Rows - 1;   /* put ':' on this line */
!                           skip_redraw = TRUE;       /* skip redraw once */
!                           need_wait_return = FALSE; /* don't wait in main() */
!                       }
                       /*FALLTHROUGH*/
                   case 'q':           /* quit */
                   case Ctrl_C:
                   case ESC:
 #ifdef FEAT_CON_DIALOG
!                       if (confirm_msg_used)
                       {
!                           /* Jump to the choices of the dialog. */
!                           s = confirm_msg_tail;
                           lines_left = Rows - 1;
                       }
                       else
***************
*** 2293,2300 ****
     return retval;
 }

- char_u        *confirm_msg = NULL;        /* ":confirm" message */
-
 /*
  * Format the dialog string, and display it at the bottom of
  * the screen. Return a string of hotkey chars (if defined) for
--- 2302,2307 ----
***************
*** 2362,2367 ****
--- 2369,2377 ----
     r = buttons;
     *q = (char_u)TO_LOWER(*r);        /* define lowercase hotkey */

+     /* Remember where the choices start, displaying starts here when "q" typed
+      * at the more prompt. */
+     confirm_msg_tail = p;
     *p++ = '\n';

     while (*r)
***************
*** 2410,2419 ****
 display_confirm_msg()
 {
     /* avoid that 'q' at the more prompt truncates the message here */
!     ++msg_noquit_more;
     if (confirm_msg != NULL)
       msg_puts_attr(confirm_msg, hl_attr(HLF_M));
!     --msg_noquit_more;
 }

 #endif /* FEAT_CON_DIALOG */
--- 2420,2429 ----
 display_confirm_msg()
 {
     /* avoid that 'q' at the more prompt truncates the message here */
!     ++confirm_msg_used;
     if (confirm_msg != NULL)
       msg_puts_attr(confirm_msg, hl_attr(HLF_M));
!     --confirm_msg_used;
 }

 #endif /* FEAT_CON_DIALOG */
*** ../vim61b.010/src/version.c Fri Mar 15 21:21:57 2002
--- src/version.c       Fri Mar 15 21:33:41 2002
***************
*** 608,609 ****
--- 608,611 ----
 {   /* Add new patch number below this line */
+ /**/
+     11,
 /**/

--
I'm sure that I asked CBuilder to do a "full" install.  Looks like I got
a "fool" install, instead.              Charles E Campbell, Jr, PhD


///  Bram Moolenaar -- [email protected] -- http://www.moolenaar.net  \\\
///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
\\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///