Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

vimdev · Vim (Vi IMproved) text editor developers list

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 27063 - 27092 of 69705   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#27063 From: Aron Griffis <agriffis@...>
Date: Sat Feb 2, 2002 6:15 pm
Subject: Re: Vim eats 100% CPU on loss of tty
agriffis@...
Send Email Send Email
 
Hello Bram,

Bram Moolenaar wrote: [Sat Feb  2 2002,  6:03:25AM EST]
> I'm not convinced this is a problem in Vim itself.  It's possibly a
> problem in a library function.  Did you try compiling without python?

Good call, it seems to work fine when the Python interpreter isn't
included.  However Gentoo Linux developers generally prefer Python over
other interpreters, so it seems a shame to leave it out.  Do you know
how it should be fixed, or at least band-aid the problem?

IMHO, these kinds of bugs are pretty important to fix (even if
ultimately the problem lies in Python).  Vim is made much more powerful
by the ability to script it in multiple languages.

There is also a bug in the tcl interpreter that I've noticed, so I leave
it out of the Gentoo build.  When I use --enable-tclinterp, then the
following command never returns:

     VIMINIT='let OS = system("uname -s")' vim

Thanks,
Aron

--
Aron Griffis
Tru64 UNIX LAN Drivers
Compaq Computer Corporation, ZKO3-3/T30

#27064 From: Bram Moolenaar <Bram@...>
Date: Sat Feb 2, 2002 6:37 pm
Subject: Re: Vim eats 100% CPU on loss of tty
Bram@...
Send Email Send Email
 
Aron Griffis wrote:

> Bram Moolenaar wrote: [Sat Feb  2 2002,  6:03:25AM EST]
> > I'm not convinced this is a problem in Vim itself.  It's possibly a
> > problem in a library function.  Did you try compiling without python?
>
> Good call, it seems to work fine when the Python interpreter isn't
> included.  However Gentoo Linux developers generally prefer Python over
> other interpreters, so it seems a shame to leave it out.  Do you know
> how it should be fixed, or at least band-aid the problem?

I can't reproduce the problem (on FreeBSD), so at least it depends on
the system.  It has something to do with threads and signals.  Using the
python interface introduces threads.

> IMHO, these kinds of bugs are pretty important to fix (even if
> ultimately the problem lies in Python).  Vim is made much more powerful
> by the ability to script it in multiple languages.

It might not be so easy to fix this bug.  Perhaps there is a version of
Python without threads?  Or a thread-safe version of the libraries?  On
my system I must compile with "-pthread" to avoid problems.

> There is also a bug in the tcl interpreter that I've noticed, so I leave
> it out of the Gentoo build.  When I use --enable-tclinterp, then the
> following command never returns:
>
>     VIMINIT='let OS = system("uname -s")' vim

Works fine for me (on FreeBSD again).

--
hundred-and-one symptoms of being an internet addict:
161. You get up before the sun rises to check your e-mail, and you
      find yourself in the very same chair long after the sun has set.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27065 From: Bram Moolenaar <Bram@...>
Date: Sat Feb 2, 2002 9:16 pm
Subject: Patch 6.0.161 (extra)
Bram@...
Send Email Send Email
 
Patch 6.0.161
Problem:    Win32: Bitmaps don't work with signs.
Solution:   Make it possible to use bitmaps with signs. (Muraoka Taro)
Files:     src/ex_cmds.c, src/feature.h, src/gui_w32.c, src/gui_x11.c,
	     src/proto/gui_w32.pro, src/proto/gui_x11.pro


*** ../vim60.160/src/ex_cmds.c Thu Jan 10 20:17:24 2002
--- src/ex_cmds.c Sat Feb  2 21:55:07 2002
***************
*** 5064,5070 ****
       char_u *sn_name; /* name of sign */
       char_u *sn_icon; /* name of pixmap */
   #ifdef FEAT_SIGN_ICONS
!     XImage *sn_image; /* icon image */
   #endif
       char_u *sn_text; /* text used instead of pixmap */
       int  sn_line_hl; /* highlight ID for line */
--- 5064,5070 ----
       char_u *sn_name; /* name of sign */
       char_u *sn_icon; /* name of pixmap */
   #ifdef FEAT_SIGN_ICONS
!     void *sn_image; /* icon image */
   #endif
       char_u *sn_text; /* text used instead of pixmap */
       int  sn_line_hl; /* highlight ID for line */
***************
*** 5565,5571 ****

       for (sp = first_sign; sp != NULL; sp = sp->sn_next)
  	 if (sp->sn_typenr == typenr)
! 	    return (void *)sp->sn_image;
       return NULL;
   }
   #endif
--- 5565,5571 ----

       for (sp = first_sign; sp != NULL; sp = sp->sn_next)
  	 if (sp->sn_typenr == typenr)
! 	    return sp->sn_image;
       return NULL;
   }
   #endif
*** ../vim60.160/src/feature.h Tue Jan 22 16:39:07 2002
--- src/feature.h Sat Feb  2 22:00:58 2002
***************
*** 1064,1071 ****
    */
   #if defined(FEAT_BIG) || defined(FEAT_SUN_WORKSHOP)
   # define FEAT_SIGNS
! # if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
!  && defined(HAVE_X11_XPM_H)
   #  define FEAT_SIGN_ICONS
   # endif
   #endif
--- 1064,1072 ----
    */
   #if defined(FEAT_BIG) || defined(FEAT_SUN_WORKSHOP)
   # define FEAT_SIGNS
! # if ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
!  && defined(HAVE_X11_XPM_H)) \
!  || (defined(WIN32) && defined(FEAT_GUI))
   #  define FEAT_SIGN_ICONS
   # endif
   #endif
*** ../vim60.160/src/gui_w32.c Tue Jan  1 23:08:31 2002
--- src/gui_w32.c Sat Feb  2 21:59:29 2002
***************
*** 3387,3390 ****
--- 3387,3513 ----
   }
   # endif

+ #endif
+
+ #if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+ typedef struct _signicon_t
+ {
+     HANDLE hImage;
+     UINT uType;
+ } signicon_t;
+
+     void
+ gui_mch_drawsign(row, col, typenr)
+     int  row;
+     int  col;
+     int  typenr;
+ {
+     signicon_t *sign;
+     int x, y, w, h;
+
+     if (!gui.in_use || (sign = (signicon_t *)sign_get_image(typenr)) == NULL)
+  return;
+
+     x = TEXT_X(col);
+     y = TEXT_Y(row);
+     w = gui.char_width * 2;
+     h = gui.char_height;
+     switch (sign->uType)
+     {
+  case IMAGE_BITMAP:
+ 	    {
+ 	 HDC hdcMem;
+ 	 HBITMAP hbmpOld;
+
+ 	 hdcMem = CreateCompatibleDC(s_hdc);
+ 	 hbmpOld = (HBITMAP)SelectObject(hdcMem, sign->hImage);
+ 	 BitBlt(s_hdc, x, y, w, h, hdcMem, 0, 0, SRCCOPY);
+ 	 SelectObject(hdcMem, hbmpOld);
+ 	 DeleteDC(hdcMem);
+ 	    }
+ 	    break;
+  case IMAGE_ICON:
+  case IMAGE_CURSOR:
+ 	    DrawIconEx(s_hdc, x, y, (HICON)sign->hImage, w, h, 0, NULL, DI_NORMAL);
+ 	    break;
+     }
+ }
+
+     static void
+ close_signicon_image(signicon_t *sign)
+ {
+     if (sign)
+  switch (sign->uType)
+  {
+ 	    case IMAGE_BITMAP:
+ 	 DeleteObject((HGDIOBJ)sign->hImage);
+ 	 break;
+ 	    case IMAGE_CURSOR:
+ 	 DestroyCursor((HCURSOR)sign->hImage);
+ 	 break;
+ 	    case IMAGE_ICON:
+ 	 DestroyIcon((HICON)sign->hImage);
+ 	 break;
+  }
+ }
+
+     void *
+ gui_mch_register_sign(signfile)
+     char_u *signfile;
+ {
+     signicon_t sign, *psign;
+     char_u *ext;
+
+     if (is_winnt_3())
+     {
+  /* TODO: May be changed this message */
+  EMSG(_("E255: Couldn't read in sign data!"));
+  return NULL;
+     }
+
+     sign.hImage = NULL;
+     ext = signfile + STRLEN(signfile) - 4; /* get extention */
+     if (ext > signfile)
+     {
+  int do_load = 1;
+
+  if (!STRICMP(ext, ".bmp"))
+ 	    sign.uType =  IMAGE_BITMAP;
+  else if (!STRICMP(ext, ".ico"))
+ 	    sign.uType =  IMAGE_ICON;
+  else if (!STRICMP(ext, ".cur") || !STRICMP(ext, ".ani"))
+ 	    sign.uType =  IMAGE_CURSOR;
+  else
+ 	    do_load = 0;
+
+  if (do_load)
+ 	    sign.hImage = (HANDLE)LoadImage(NULL, signfile, sign.uType,
+ 		    gui.char_width * 2, gui.char_height,
+ 		    LR_LOADFROMFILE | LR_CREATEDIBSECTION);
+     }
+
+     psign = NULL;
+     if (sign.hImage && (psign = (signicon_t *)alloc(sizeof(signicon_t))))
+  *psign = sign;
+
+     if (!psign)
+     {
+  if (sign.hImage)
+ 	    close_signicon_image(&sign);
+  EMSG(_("E255: Couldn't read in sign data!"));
+     }
+     return (void *)psign;
+
+ }
+
+     void
+ gui_mch_destroy_sign(sign)
+     void *sign;
+ {
+     if (sign)
+     {
+  close_signicon_image((signicon_t *)sign);
+  vim_free(sign);
+     }
+ }
   #endif
*** ../vim60.160/src/gui_x11.c Wed Sep 26 16:15:32 2001
--- src/gui_x11.c Sat Feb  2 21:52:29 2002
***************
*** 3210,3216 ****
       }
   }

!     XImage *
   gui_mch_register_sign(signfile)
       char_u     *signfile;
   {
--- 3210,3216 ----
       }
   }

!     void *
   gui_mch_register_sign(signfile)
       char_u     *signfile;
   {
***************
*** 3259,3272 ****
  	 }
       }

!     return sign;
   }

       void
   gui_mch_destroy_sign(sign)
!     XImage *sign;
   {
!     XFree(sign->data);
       vim_free(sign);
   }
   #endif
--- 3259,3272 ----
  	 }
       }

!     return (void *)sign;
   }

       void
   gui_mch_destroy_sign(sign)
!     void *sign;
   {
!     XFree(((XImage *)sign)->data);
       vim_free(sign);
   }
   #endif
*** ../vim60.160/src/proto/gui_w32.pro Tue Sep 25 21:49:31 2001
--- src/proto/gui_w32.pro Sat Feb  2 22:11:29 2002
***************
*** 74,77 ****
--- 74,80 ----
   void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
   int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u
*buttons, int dfltbutton, char_u *textfield));
   void gui_mch_set_foreground __ARGS((void));
+ void gui_mch_drawsign __ARGS((int row, int col, int typenr));
+ void *gui_mch_register_sign __ARGS((char_u *signfile));
+ void gui_mch_destroy_sign __ARGS((void *sign));
   /* vim: set ft=c : */
*** ../vim60.160/src/proto/gui_x11.pro Tue Sep 25 21:49:30 2001
--- src/proto/gui_x11.pro Sat Feb  2 22:06:55 2002
***************
*** 61,68 ****
   void gui_mch_setmouse __ARGS((int x, int y));
   XButtonPressedEvent *gui_x11_get_last_mouse_event __ARGS((void));
   void gui_mch_drawsign __ARGS((int row, int col, int typenr));
! XImage *gui_mch_register_sign __ARGS((char_u *signfile));
! void gui_mch_destroy_sign __ARGS((XImage *sign));
   void gui_mch_mousehide __ARGS((int hide));
   void mch_set_mouse_shape __ARGS((int shape));
   void get_toolbar_pixmap __ARGS((vimmenu_T *menu, Pixmap *sen, Pixmap *insen));
--- 61,68 ----
   void gui_mch_setmouse __ARGS((int x, int y));
   XButtonPressedEvent *gui_x11_get_last_mouse_event __ARGS((void));
   void gui_mch_drawsign __ARGS((int row, int col, int typenr));
! void *gui_mch_register_sign __ARGS((char_u *signfile));
! void gui_mch_destroy_sign __ARGS((void *sign));
   void gui_mch_mousehide __ARGS((int hide));
   void mch_set_mouse_shape __ARGS((int shape));
   void get_toolbar_pixmap __ARGS((vimmenu_T *menu, Pixmap *sen, Pixmap *insen));
*** ../vim60.160/src/version.c Fri Feb  1 20:29:26 2002
--- src/version.c Sat Feb  2 22:12:13 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     161,
   /**/

--
hundred-and-one symptoms of being an internet addict:
164. You got out to buy software, instead of going out for a beer.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27066 From: Aron Griffis <agriffis@...>
Date: Sun Feb 3, 2002 1:33 am
Subject: Re: Vim eats 100% CPU on loss of tty
agriffis@...
Send Email Send Email
 
Bram Moolenaar wrote: [Sat Feb  2 2002,  1:37:18PM EST]
> It might not be so easy to fix this bug.  Perhaps there is a version of
> Python without threads?  Or a thread-safe version of the libraries?  On
> my system I must compile with "-pthread" to avoid problems.

I'll investigate these questions.  Gcc doesn't have a -pthread option.
I know that leaving threads out would be unfortunate for my friend who
writes Python-based threaded Vim plugins.  :-)

Does the Perl interpreter not have this problem, even when threads are
enabled?  If not, I wonder what the difference is.

> > There is also a bug in the tcl interpreter that I've noticed, so I leave
> > it out of the Gentoo build.  When I use --enable-tclinterp, then the
> > following command never returns:
> >
> >     VIMINIT='let OS = system("uname -s")' vim
>
> Works fine for me (on FreeBSD again).

I spent a while trying to debug this on Linux and didn't get that far.
But I didn't care much about the tcl interpreter, so finally I just left
it out of the Gentoo ebuild.

Thanks,
Aron

--
Aron Griffis
Tru64 UNIX LAN Drivers
Compaq Computer Corporation, ZKO3-3/T30

#27067 From: Matthew Hawkins <matt@...>
Date: Sun Feb 3, 2002 2:05 am
Subject: Re: Vim eats 100% CPU on loss of tty
matt@...
Send Email Send Email
 
On Sat, 02 Feb 2002, Aron Griffis wrote:
> I'll investigate these questions.  Gcc doesn't have a -pthread option.

It does on FreeBSD, where it signals that ld should link with the
reentrant version of libc instead of the non-reentrant version.
This is because the pthread library functions are in the reentrant
version of libc and not a separate pthread library.  It also supposedly
alters a few other library functions so they are thread safe.

I've seen the problem here on a Linux box twice in the past month or
so, it's also an SMP system so I don't know if that matters or not.
I never ssh into my freebsd box so I've never noticed it on that
platform.  I haven't seen it happen on Solaris either, though that's
through lack of trying ;)

--
Matt

#27068 From: "Muraoka Taro" <koron@...>
Date: Sun Feb 3, 2002 11:38 am
Subject: Re: win32 gvim: font width problem
koron@...
Send Email Send Email
 
I wrote new patch.
Please check it.

----- Original Message -----
From: <KGD03011@...>
To: <koron@...>
Sent: Sunday, February 03, 2002 5:09 PM
Subject: Re: win32 gvim: font width problem

(snip)
> But I've noticed these problems:
>
> 1. Starting VIM and changing fonts and font sizes is very slow
> (15 to 30 seconds).

Try new one.  Cache became more clever than before.

> 2. At font-sizes 26 and 28 with Japanese fonts in utf-8, Vim
> seems to think that all characters, including kana, CJK etc, are
> half-width.

May be fixed.  But there is another problem, Windows compress width of
drawing text when using big size font.  As a result of this, some dust
will be shown.

> 3. In utf-8, an insertion of text that moves text to near the
> right margin of the window causes a crash. This does not happen
> with cp932.

I can't reproduce this.
----
Muraoka Taro  <koron@...>

#27069 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 11:46 am
Subject: Patch 6.0.162 (extra)
Bram@...
Send Email Send Email
 
Patch 6.0.162
Problem:    Client-server: An error message for a wrong expression appears in
	     the server instead of the cient.
Solution:   Pass the error message from the server to the client.  Also
	     adjust the example code. (Flemming Madsen)
Files:     src/globals.h, src/if_xcmdsrv.c, src/main.c, src/os_mswin.c,
	     src/proto/if_xcmdsrv.pro, src/proto/os_mswin.pro,
	     runtime/doc/eval.txt, runtime/tools/xcmdsrv_client.c


*** ../vim60.161/src/globals.h Fri Nov  2 16:29:44 2001
--- src/globals.h Sun Feb  3 11:57:48 2002
***************
*** 1132,1137 ****
--- 1133,1141 ----
   EXTERN char_u e_zerocount[] INIT(=N_("Zero count"));
   #ifdef FEAT_EVAL
   EXTERN char_u e_usingsid[] INIT(=N_("E81: Using <SID> not in a script
context"));
+ #endif
+ #ifdef FEAT_CLIENTSERVER
+ EXTERN char_u e_invexprmsg[] INIT(=N_("E449: Invalid expression received"));
   #endif

   /*
*** ../vim60.161/src/if_xcmdsrv.c Sat Nov  3 14:16:30 2001
--- src/if_xcmdsrv.c Sun Feb  3 12:18:33 2002
***************
*** 70,75 ****
--- 70,76 ----
   typedef struct PendingCommand
   {
       int     serial; /* Serial number expected in result. */
+     int     code; /* Result Code. 0 is OK */
       char_u  *result; /* String result for command (malloc'ed).
  			  * NULL means command still pending. */
       struct PendingCommand *nextPtr;
***************
*** 136,141 ****
--- 137,145 ----
    * defaults to an empty string.
    *
    * -c code
+  * 0: for OK. This is the default.
+  * 1: for error: Result is the last error
+  *
    * -i errorInfo
    * -e errorCode
    * Not applicable for Vim
***************
*** 385,393 ****
  	     ret = eval_to_string(cmd, NULL);
  	     --emsg_skip;
  	     if (result != NULL)
! 	 *result = ret;
  	     else
  		 vim_free(ret);
  	 }
  	 else
  	     server_to_input_buf(cmd);
--- 389,403 ----
  	     ret = eval_to_string(cmd, NULL);
  	     --emsg_skip;
  	     if (result != NULL)
! 	    {
! 	 if (ret == NULL)
! 		    *result = vim_strsave(_(e_invexprmsg));
! 	 else
! 		    *result = ret;
! 	    }
  	     else
  		 vim_free(ret);
+ 	    return ret == NULL ? -1 : 0;
  	 }
  	 else
  	     server_to_input_buf(cmd);
***************
*** 461,466 ****
--- 471,477 ----
        * AppendErrorProc to pass back the command's results).
        */
       pending.serial = serial;
+     pending.code = 0;
       pending.result = NULL;
       pending.nextPtr = pendingCommands;
       pendingCommands = &pending;
***************
*** 489,495 ****
       else
  	 vim_free(pending.result);

!     return 0;
   }

       static int
--- 500,506 ----
       else
  	 vim_free(pending.result);

!     return pending.code == 0 ? 0 : -1;
   }

       static int
***************
*** 1092,1098 ****
   {
       char_u *propInfo;
       char_u *p;
!     int  result, actualFormat;
       long_u numItems, bytesAfter;
       Atom actualType;

--- 1103,1109 ----
   {
       char_u *propInfo;
       char_u *p;
!     int  result, actualFormat, code;
       long_u numItems, bytesAfter;
       Atom actualType;

***************
*** 1223,1228 ****
--- 1234,1245 ----
  	     {
  		 if (res != NULL)
  		     ga_concat(&reply, res);
+ 	 else if (asKeys == 0)
+ 	 {
+ 		    ga_concat(&reply, _(e_invexprmsg));
+ 		    ga_append(&reply, 0);
+ 		    ga_concat(&reply, "-c 1");
+ 	 }
  		 ga_append(&reply, 0);
  		 (void)AppendPropCarefully(dpy, resWindow, commProperty,
  					    reply.ga_data, reply.ga_len);
***************
*** 1243,1248 ****
--- 1260,1266 ----
  	     p += 2;
  	     gotSerial = 0;
  	     res = (char_u *)"";
+ 	    code = 0;
  	     while ((p-propInfo) < numItems && *p == '-')
  	     {
  		 switch (p[1])
***************
*** 1255,1260 ****
--- 1273,1282 ----
  			 if (sscanf((char *)p + 2, " %d", &serial) == 1)
  			     gotSerial = 1;
  			 break;
+ 		    case 'c':
+ 		 if (sscanf((char *)p + 2, " %d", &code) != 1)
+ 			    code = 0;
+ 		 break;
  		 }
  		 while (*p != 0)
  		     p++;
***************
*** 1273,1278 ****
--- 1295,1301 ----
  		 if (serial != pcPtr->serial || pcPtr->result != NULL)
  		     continue;

+ 	 pcPtr->code = code;
  		 if (res != NULL)
  		     pcPtr->result = vim_strsave(res);
  		 else
*** ../vim60.161/src/main.c Mon Nov  5 22:06:57 2001
--- src/main.c Sun Feb  3 11:45:33 2002
***************
*** 2628,2634 ****
  		     while (memchr(done, 0, numFiles) != NULL)
  		     {
   # ifdef WIN32
! 		 p = serverGetReply(srv, FALSE, TRUE, TRUE);
  			 if (p == NULL)
  			     break;
   # else
--- 2628,2634 ----
  		     while (memchr(done, 0, numFiles) != NULL)
  		     {
   # ifdef WIN32
! 		 p = serverGetReply(srv, NULL, TRUE, TRUE);
  			 if (p == NULL)
  			     break;
   # else
*** ../vim60.161/src/os_mswin.c Sun Dec 30 21:52:17 2001
--- src/os_mswin.c Sun Feb  3 11:57:57 2002
***************
*** 1716,1725 ****

   /* Communication is via WM_COPYDATA messages. The message type is send in
    * the dwData parameter. Types are defined here. */
! #define COPYDATA_KEYS 0
! #define COPYDATA_REPLY 1
! #define COPYDATA_EXPR 10
! #define COPYDATA_RESULT 11

   /* This is a structure containing a server HWND and its name. */
   struct server_id
--- 1716,1726 ----

   /* Communication is via WM_COPYDATA messages. The message type is send in
    * the dwData parameter. Types are defined here. */
! #define COPYDATA_KEYS  0
! #define COPYDATA_REPLY  1
! #define COPYDATA_EXPR  10
! #define COPYDATA_RESULT  11
! #define COPYDATA_ERROR_RESULT 12

   /* This is a structure containing a server HWND and its name. */
   struct server_id
***************
*** 1775,1780 ****
--- 1776,1784 ----
  	  *   COPYDATA_RESULT:
  	  * A reply. We are a client, and a server has sent this message
  	  * in response to a COPYDATA_EXPR.
+ 	 *   COPYDATA_ERROR_RESULT:
+ 	 * A reply. We are a client, and a server has sent this message
+ 	 * in response to a COPYDATA_EXPR that failed to evaluate.
  	  */
  	 COPYDATASTRUCT *data = (COPYDATASTRUCT*)lParam;
  	 HWND  sender = (HWND)wParam;
***************
*** 1808,1815 ****
  	     res = eval_to_string(data->lpData, NULL);
  	     --emsg_skip;
  	     if (res == NULL)
! 	 res = vim_strsave((char_u *)"");
! 	    reply.dwData = COPYDATA_RESULT;
  	     reply.lpData = res;
  	     reply.cbData = STRLEN(res) + 1;

--- 1812,1823 ----
  	     res = eval_to_string(data->lpData, NULL);
  	     --emsg_skip;
  	     if (res == NULL)
! 	    {
! 	 res = vim_strsave(_(e_invexprmsg));
! 	 reply.dwData = COPYDATA_ERROR_RESULT;
! 	    }
! 	    else
! 	 reply.dwData = COPYDATA_RESULT;
  	     reply.lpData = res;
  	     reply.cbData = STRLEN(res) + 1;

***************
*** 1820,1829 ****

  	 case COPYDATA_REPLY:
  	 case COPYDATA_RESULT:
  	     if (data->lpData != NULL)
  	     {
  		 save_reply(sender, data->lpData,
! 					     data->dwData == COPYDATA_RESULT);
   #ifdef FEAT_AUTOCMD
  		 if (data->dwData == COPYDATA_REPLY)
  		 {
--- 1828,1840 ----

  	 case COPYDATA_REPLY:
  	 case COPYDATA_RESULT:
+  case COPYDATA_ERROR_RESULT:
  	     if (data->lpData != NULL)
  	     {
  		 save_reply(sender, data->lpData,
! 			   (data->dwData == COPYDATA_REPLY ?  0 :
! 			   (data->dwData == COPYDATA_RESULT ? 1 :
! 							      2)));
   #ifdef FEAT_AUTOCMD
  		 if (data->dwData == COPYDATA_REPLY)
  		 {
***************
*** 2071,2076 ****
--- 2082,2088 ----
       HWND target = findServer(name);
       COPYDATASTRUCT data;
       char_u *retval = NULL;
+     int  retcode = 0;

       if (ptarget)
  	 *(HWND *)ptarget = target;
***************
*** 2084,2097 ****
  	 return -1;

       if (asExpr)
!  retval = serverGetReply(target, TRUE, TRUE, TRUE);

       if (result == NULL)
  	 vim_free(retval);
       else
  	 *result = retval; /* Caller assumes responsibility for freeing */

!     return 0;
   }

   /*
--- 2096,2109 ----
  	 return -1;

       if (asExpr)
!  retval = serverGetReply(target, &retcode, TRUE, TRUE);

       if (result == NULL)
  	 vim_free(retval);
       else
  	 *result = retval; /* Caller assumes responsibility for freeing */

!     return retcode;
   }

   /*
***************
*** 2119,2125 ****
   {
       HWND server;  /* server window */
       char_u *reply;  /* reply string */
!     int  expr_result; /* TRUE for COPYDATA_RESULT */
   }
   reply_T;

--- 2131,2137 ----
   {
       HWND server;  /* server window */
       char_u *reply;  /* reply string */
!     int  expr_result; /* 0 for REPLY, 1 for RESULT 2 for error */
   }
   reply_T;

***************
*** 2155,2167 ****

   /*
    * Get a reply from server "server".
!  * When "expr" is TRUE, get the result of an expression, otherwise a
    * server2client() message.
    * If "remove" is TRUE, consume the message, the caller must free it then.
    * if "wait" is TRUE block until a message arrives (or the server exits).
    */
       char_u *
! serverGetReply(HWND server, int expr, int remove, int wait)
   {
       int  i;
       char_u *reply;
--- 2167,2180 ----

   /*
    * Get a reply from server "server".
!  * When "expr_res" is non NULL, get the result of an expression, otherwise a
    * server2client() message.
+  * When non NULL, point to return code. 0 => OK, -1 => ERROR
    * If "remove" is TRUE, consume the message, the caller must free it then.
    * if "wait" is TRUE block until a message arrives (or the server exits).
    */
       char_u *
! serverGetReply(HWND server, int *expr_res, int remove, int wait)
   {
       int  i;
       char_u *reply;
***************
*** 2177,2186 ****
  	 for (i = 0; i < REPLY_COUNT; ++i)
  	 {
  	     rep = REPLY_ITEM(i);
! 	    if (rep->server == server && rep->expr_result == expr)
  	     {
  		 /* Save the values we've found for later */
  		 reply = rep->reply;

  		 if (remove)
  		 {
--- 2190,2202 ----
  	 for (i = 0; i < REPLY_COUNT; ++i)
  	 {
  	     rep = REPLY_ITEM(i);
! 	    if (rep->server == server
! 		    && ((rep->expr_result != 0) == (expr_res != NULL)))
  	     {
  		 /* Save the values we've found for later */
  		 reply = rep->reply;
+ 	 if (expr_res != NULL)
+ 		    *expr_res = rep->expr_result == 1 ? 0 : -1;

  		 if (remove)
  		 {
*** ../vim60.161/src/proto/os_mswin.pro Tue Sep 25 21:49:35 2001
--- src/proto/os_mswin.pro Sun Feb  3 11:45:33 2002
***************
*** 47,53 ****
   int serverSendReply __ARGS((char_u *name, char_u *reply));
   int serverSendToVim __ARGS((char_u *name, char_u *cmd, char_u **result, void
*ptarget, int asExpr));
   void serverForeground __ARGS((char_u *name));
! char_u *serverGetReply __ARGS((HWND server, int expr, int remove, int wait));
   void serverProcessPendingMessages __ARGS((void));
   char *charset_id2name __ARGS((int id));
   int get_logfont __ARGS((LOGFONT *lf, char_u *name, HDC printer_dc));
--- 47,53 ----
   int serverSendReply __ARGS((char_u *name, char_u *reply));
   int serverSendToVim __ARGS((char_u *name, char_u *cmd, char_u **result, void
*ptarget, int asExpr));
   void serverForeground __ARGS((char_u *name));
! char_u *serverGetReply __ARGS((HWND server, int *expr_res, int remove, int
wait));
   void serverProcessPendingMessages __ARGS((void));
   char *charset_id2name __ARGS((int id));
   int get_logfont __ARGS((LOGFONT *lf, char_u *name, HDC printer_dc));
*** ../vim60.161/runtime/doc/eval.txt Tue Sep 25 21:40:34 2001
--- runtime/doc/eval.txt Sun Feb  3 11:51:14 2002
***************
*** 671,676 ****
--- 679,685 ----

  					 *v:servername* *servername-variable*
   v:servername The resulting registered |x11-clientserver| name if any.
+ 	 Read-only.

  					 *v:shell_error* *shell_error-variable*
   v:shell_error Result of the last shell command.  When non-zero, the last
***************
*** 1189,1195 ****
  			 <sfile>  sourced script file name
  			 <cword>  word under the cursor
  			 <cWORD>  WORD under the cursor
! 		 <client> The {serverid} of the las
  		 Modifiers:
  			 :p  expand to full path
  			 :h  head (last path component removed)
--- 1205,1212 ----
  			 <sfile>  sourced script file name
  			 <cword>  word under the cursor
  			 <cWORD>  WORD under the cursor
! 		 <client> the {clientid} of the last received
! 				 message |server2client()|
  		 Modifiers:
  			 :p  expand to full path
  			 :h  head (last path component removed)
***************
*** 1864,1870 ****
   <  When {lnum} is invalid or there is no non-blank line at or
  		 above it, zero is returned.

! 						 *remote_expr()*
   remote_expr({server}, {string} [, {idvar}])
  		 Send the {string} to {server}.  The string is sent as an
  		 expression and the result is returned after evaluation.
--- 1874,1880 ----
   <  When {lnum} is invalid or there is no non-blank line at or
  		 above it, zero is returned.

! 						 *remote_expr()* *E449*
   remote_expr({server}, {string} [, {idvar}])
  		 Send the {string} to {server}.  The string is sent as an
  		 expression and the result is returned after evaluation.
***************
*** 1873,1883 ****
  		 remote_read() is stored there.
  		 See also |clientserver| |RemoteReply|.
  		 {only available when compiled with the |+clientserver| feature}
! 	 Note: Any errors will be reported in the server and may mess
! 	 up the display.
  		 Examples: >
  			 :echo remote_expr("gvim", "2+2")
! 		 :echo remote_expr("gvim-001", "b:current_syntax")
   <

   remote_foreground({server}) 		 *remote_foreground()*
--- 1883,1893 ----
  		 remote_read() is stored there.
  		 See also |clientserver| |RemoteReply|.
  		 {only available when compiled with the |+clientserver| feature}
! 	 Note: Any errors will cause a local error message to be issued
! 	 and the result will be the empty string.
  		 Examples: >
  			 :echo remote_expr("gvim", "2+2")
! 		 :echo remote_expr("gvim1", "b:current_syntax")
   <

   remote_foreground({server}) 		 *remote_foreground()*
*** ../vim60.161/runtime/tools/xcmdsrv_client.c Sun Sep  2 14:51:52 2001
--- runtime/tools/xcmdsrv_client.c Sun Feb  3 11:45:33 2002
***************
*** 32,50 ****
   #define __ARGS(x) x

   /* Client API */
! char * sendToVim __ARGS((Display *dpy, char *name, char *cmd, int asKeys));

   #ifdef MAIN
   /* A sample program */
   main(int argc, char **argv)
   {
!     char *res;

       if (argc == 4)
       {
!  if ((res = sendToVim(XOpenDisplay(NULL),
! 			     argv[2], argv[3], argv[1][0] != 'e')) != NULL)
  	     puts(res);
  	 exit(0);
       }
       else
--- 32,55 ----
   #define __ARGS(x) x

   /* Client API */
! char * sendToVim __ARGS((Display *dpy, char *name, char *cmd, int asKeys, int
*code));

   #ifdef MAIN
   /* A sample program */
   main(int argc, char **argv)
   {
!     char    *res;
!     int     code;

       if (argc == 4)
       {
!  if ((res = sendToVim(XOpenDisplay(NULL), argv[2], argv[3],
! 			     argv[1][0] != 'e', &code)) != NULL)
!  {
! 	    if (code)
! 	 printf("Error code returned: %d\n", code);
  	     puts(res);
+  }
  	 exit(0);
       }
       else
***************
*** 72,78 ****
  		     int delete, char **loose));
   static int SendInit __ARGS((Display *dpy));
   static char *SendEventProc __ARGS((Display *dpy, XEvent *eventPtr,
! 				      int expect));
   static int IsSerialName __ARGS((char *name));

   /* Private variables */
--- 77,83 ----
  		     int delete, char **loose));
   static int SendInit __ARGS((Display *dpy));
   static char *SendEventProc __ARGS((Display *dpy, XEvent *eventPtr,
! 				      int expect, int *code));
   static int IsSerialName __ARGS((char *name));

   /* Private variables */
***************
*** 91,101 ****
    */

       char *
! sendToVim(dpy, name, cmd, asKeys)
       Display *dpy; 	 /* Where to send. */
       char *name; 	 /* Where to send. */
       char *cmd; 	 /* What to send. */
       int  asKeys; 	 /* Interpret as keystrokes or expr ? */
   {
       Window     w;
       Atom     *plist;
--- 96,107 ----
    */

       char *
! sendToVim(dpy, name, cmd, asKeys, code)
       Display *dpy; 	 /* Where to send. */
       char *name; 	 /* Where to send. */
       char *cmd; 	 /* What to send. */
       int  asKeys; 	 /* Interpret as keystrokes or expr ? */
+     int  *code; 	 /* Return code. 0 => OK */
   {
       Window     w;
       Atom     *plist;
***************
*** 225,231 ****
  	 {
  	     XNextEvent(dpy, &event);
  	     if (event.type == PropertyNotify && e->window == commWindow)
! 	 if ((result = SendEventProc(dpy, &event, serial)) != NULL)
  		     return result;
  	 }
       }
--- 231,237 ----
  	 {
  	     XNextEvent(dpy, &event);
  	     if (event.type == PropertyNotify && e->window == commWindow)
! 	 if ((result = SendEventProc(dpy, &event, serial, code)) != NULL)
  		     return result;
  	 }
       }
***************
*** 335,341 ****
  	 entry = p;
  	 while ((*p != 0) && (!isspace(*p)))
  	     p++;
!  if ((*p != 0) && (strcmp(name, p + 1) == 0))
  	 {
  	     sscanf(entry, "%x", (uint*) &returnValue);
  	     break;
--- 341,347 ----
  	 entry = p;
  	 while ((*p != 0) && (!isspace(*p)))
  	     p++;
!  if ((*p != 0) && (strcasecmp(name, p + 1) == 0))
  	 {
  	     sscanf(entry, "%x", (uint*) &returnValue);
  	     break;
***************
*** 392,405 ****
   }

       static char *
! SendEventProc(dpy, eventPtr, expected)
       Display    *dpy;
       XEvent     *eventPtr;  /* Information about event. */
       int 	    expected;  /* The one were waiting for */
   {
       unsigned char   *propInfo;
       unsigned char   *p;
       int 	    result, actualFormat;
       unsigned long   numItems, bytesAfter;
       Atom     actualType;

--- 398,413 ----
   }

       static char *
! SendEventProc(dpy, eventPtr, expected, code)
       Display    *dpy;
       XEvent     *eventPtr;  /* Information about event. */
       int 	    expected;  /* The one were waiting for */
+     int 	    *code;              /* Return code. 0 => OK */
   {
       unsigned char   *propInfo;
       unsigned char   *p;
       int 	    result, actualFormat;
+     int 	    retCode;
       unsigned long   numItems, bytesAfter;
       Atom     actualType;

***************
*** 469,474 ****
--- 477,483 ----
  	     p += 2;
  	     gotSerial = 0;
  	     res = "";
+ 	    retCode = 0;
  	     while (((p-propInfo) < numItems) && (*p == '-'))
  	     {
  		 switch (p[1])
***************
*** 481,486 ****
--- 490,499 ----
  			 if (sscanf(p + 2, " %d", &serial) == 1)
  			     gotSerial = 1;
  			 break;
+ 		    case 'c':
+ 		 if (sscanf(p + 2, " %d", &retCode) != 1)
+ 			    retCode = 0;
+ 		 break;
  		 }
  		 while (*p != 0)
  		     p++;
***************
*** 490,495 ****
--- 503,510 ----
  	     if (!gotSerial)
  		 continue;

+ 	    if (code != NULL)
+ 	 *code = retCode;
  	     return serial == expected ? strdup(res) : NULL;
  	 }
  	 else
***************
*** 556,578 ****
   }

   /*
!  * Check if name looks like it had a 3 digit serial number appended
    */
       static int
   IsSerialName(str)
!     char *str;
   {
!     if (strlen(str) < 5)
!  return FALSE;
!     str = str + strlen(str) - 4;
!     if (*str++ != '-')
!  return FALSE;
!     if (!isdigit(*str++))
!  return FALSE;
!     if (!isdigit(*str++))
!  return FALSE;
!     if (!isdigit(*str++))
!  return FALSE;

!     return TRUE;
   }
--- 571,584 ----
   }

   /*
!  * Check if "str" looks like it had a serial number appended.
!  * Actually just checks if the name ends in a digit.
    */
       static int
   IsSerialName(str)
!     char   *str;
   {
!     int len = strlen(str);

!     return (len > 1 && isdigit(str[len - 1]));
   }
*** ../vim60.161/src/version.c Sun Feb  3 12:33:39 2002
--- src/version.c Sun Feb  3 12:29:58 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     162,
   /**/

--
hundred-and-one symptoms of being an internet addict:
167. You have more than 100 websites in your Bookmark.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27070 From: "Muraoka Taro" <koron@...>
Date: Sun Feb 3, 2002 12:28 pm
Subject: can't paste using GUI
koron@...
Send Email Send Email
 
Vim can't paste any text using GUI in insert and visual mode.
GUI events are mapped by using *noremenu, it should be *menu.
Please check attached patch.
----
Muraoka Taro  <koron@...>

#27071 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 2:29 pm
Subject: Patch 6.0.163
Bram@...
Send Email Send Email
 
Patch 6.0.163
Problem:    When using a GUI dialog, a file name is sometimes used like it was
	     a directory.
Solution:   Separate path and file name properly.
	     For GTK, Motif and Athena concatenate directory and file name for
	     the default selection.
Files:     src/diff.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c,
	     src/gui_athena.c, src/gui_gtk.c, src/gui_motif.c, src/message.c


*** ../vim60.162/src/diff.c Wed Sep 19 18:36:35 2001
--- src/diff.c Sun Feb  3 13:43:37 2002
***************
*** 744,751 ****
   #ifdef FEAT_BROWSE
       if (cmdmod.browse)
       {
!  browseFile = do_browse(TRUE, (char_u *)_("Patch file"),
! 	 NULL, NULL, eap->arg, BROWSE_FILTER_ALL_FILES, curbuf);
  	 if (browseFile == NULL)
  	     return;  /* operation cancelled */
  	 eap->arg = browseFile;
--- 744,751 ----
   #ifdef FEAT_BROWSE
       if (cmdmod.browse)
       {
!  browseFile = do_browse(FALSE, (char_u *)_("Patch file"),
! 			 eap->arg, NULL, NULL, BROWSE_FILTER_ALL_FILES, NULL);
  	 if (browseFile == NULL)
  	     return;  /* operation cancelled */
  	 eap->arg = browseFile;
*** ../vim60.162/src/ex_cmds.c Sun Feb  3 12:33:39 2002
--- src/ex_cmds.c Sun Feb  3 13:29:29 2002
***************
*** 2050,2057 ****
   #ifdef FEAT_BROWSE
       if (cmdmod.browse)
       {
!  browse_file = do_browse(TRUE, (char_u *)_("Save As"), NULL,
! 						  NULL, ffname, NULL, curbuf);
  	 if (browse_file == NULL)
  	     goto theend;
  	 ffname = browse_file;
--- 2050,2057 ----
   #ifdef FEAT_BROWSE
       if (cmdmod.browse)
       {
!  browse_file = do_browse(TRUE, (char_u *)_("Save As"), ffname,
! 						    NULL, NULL, NULL, curbuf);
  	 if (browse_file == NULL)
  	     goto theend;
  	 ffname = browse_file;
***************
*** 2308,2314 ****
  	     /* ":browse wall": ask for file name if there isn't one */
  	     if (buf->b_ffname == NULL && cmdmod.browse)
  		 buf->b_ffname = do_browse(TRUE, (char_u *)_("Save As"), NULL,
! 					       NULL, (char_u *)"", NULL, buf);
   #endif
  	     if (buf->b_ffname == NULL)
  	     {
--- 2308,2314 ----
  	     /* ":browse wall": ask for file name if there isn't one */
  	     if (buf->b_ffname == NULL && cmdmod.browse)
  		 buf->b_ffname = do_browse(TRUE, (char_u *)_("Save As"), NULL,
! 						       NULL, NULL, NULL, buf);
   #endif
  	     if (buf->b_ffname == NULL)
  	     {
***************
*** 2535,2542 ****
   #ifdef FEAT_BROWSE
  	 if (cmdmod.browse)
  	 {
! 	    browse_file = do_browse(FALSE, (char_u *)_("Edit File"), NULL,
! 						  NULL, ffname, NULL, curbuf);
  	     if (browse_file == NULL)
  		 goto theend;
  	     ffname = browse_file;
--- 2535,2542 ----
   #ifdef FEAT_BROWSE
  	 if (cmdmod.browse)
  	 {
! 	    browse_file = do_browse(FALSE, (char_u *)_("Edit File"), ffname,
! 						    NULL, NULL, NULL, curbuf);
  	     if (browse_file == NULL)
  		 goto theend;
  	     ffname = browse_file;
*** ../vim60.162/src/ex_cmds2.c Wed Oct 31 10:12:03 2001
--- src/ex_cmds2.c Sun Feb  3 13:44:58 2002
***************
*** 1711,1718 ****
       {
  	 char_u *fname = NULL;

!  fname = do_browse(FALSE, (char_u *)_("Run Macro"),
! 	 NULL, NULL, eap->arg, BROWSE_FILTER_MACROS, curbuf);
  	 if (fname != NULL)
  	 {
  	     cmd_source(fname, eap);
--- 1711,1718 ----
       {
  	 char_u *fname = NULL;

!  fname = do_browse(FALSE, (char_u *)_("Run Macro"), eap->arg,
! 				      NULL, NULL, BROWSE_FILTER_MACROS, NULL);
  	 if (fname != NULL)
  	 {
  	     cmd_source(fname, eap);
*** ../vim60.162/src/ex_docmd.c Wed Jan 30 16:52:44 2002
--- src/ex_docmd.c Sun Feb  3 13:47:11 2002
***************
*** 5554,5560 ****
  	     && eap->cmdidx != CMD_new)
       {
  	 fname = do_browse(FALSE, (char_u *)_("Edit File in new window"),
! 					  NULL, NULL, eap->arg, NULL, curbuf);
  	 if (fname == NULL)
  	     goto theend;
  	 eap->arg = fname;
--- 5554,5560 ----
  	     && eap->cmdidx != CMD_new)
       {
  	 fname = do_browse(FALSE, (char_u *)_("Edit File in new window"),
! 					  eap->arg, NULL, NULL, NULL, curbuf);
  	 if (fname == NULL)
  	     goto theend;
  	 eap->arg = fname;
***************
*** 5923,5930 ****
  	 {
  	     char_u *browseFile;

! 	    browseFile = do_browse(FALSE, (char_u *)_("Append File"), NULL,
! 					 NULL, eap->arg, NULL, curbuf);
  	     if (browseFile != NULL)
  	     {
  		 i = readfile(browseFile, NULL,
--- 5923,5930 ----
  	 {
  	     char_u *browseFile;

! 	    browseFile = do_browse(FALSE, (char_u *)_("Append File"), eap->arg,
! 						    NULL, NULL, NULL, curbuf);
  	     if (browseFile != NULL)
  	     {
  		 i = readfile(browseFile, NULL,
***************
*** 6449,6455 ****
  	     if (cmdmod.browse)
  	     {
  		 browseFile = do_browse(TRUE, (char_u *)_("Save Redirection"),
! 		       NULL, NULL, eap->arg, BROWSE_FILTER_ALL_FILES, curbuf);
  		 if (browseFile == NULL)
  		     return;  /* operation cancelled */
  		 eap->arg = browseFile;
--- 6449,6455 ----
  	     if (cmdmod.browse)
  	     {
  		 browseFile = do_browse(TRUE, (char_u *)_("Save Redirection"),
! 		       eap->arg, NULL, NULL, BROWSE_FILTER_ALL_FILES, curbuf);
  		 if (browseFile == NULL)
  		     return;  /* operation cancelled */
  		 eap->arg = browseFile;
***************
*** 6601,6607 ****
  		 eap->cmdidx == CMD_mksession ? (char_u *)_("Save Session") :
   # endif
  		 (char_u *)_("Save Setup"),
! 	 NULL, (char_u *)"vim", fname, BROWSE_FILTER_MACROS, curbuf);
  	 if (browseFile == NULL)
  	     goto theend;
  	 fname = browseFile;
--- 6601,6607 ----
  		 eap->cmdidx == CMD_mksession ? (char_u *)_("Save Session") :
   # endif
  		 (char_u *)_("Save Setup"),
! 	 fname, (char_u *)"vim", NULL, BROWSE_FILTER_MACROS, NULL);
  	 if (browseFile == NULL)
  	     goto theend;
  	 fname = browseFile;
*** ../vim60.162/src/gui_athena.c Wed Dec 12 20:36:34 2001
--- src/gui_athena.c Sun Feb  3 15:24:05 2002
***************
*** 1836,1841 ****
--- 1836,1856 ----
       char_u *filter; /* not used (file name filter) */
   {
       Position x, y;
+     char_u dirbuf[MAXPATHL];
+
+     /* Concatenate "initdir" and "dflt". */
+     if (initdir == NULL || *initdir == NUL)
+  mch_dirname(dirbuf, MAXPATHL);
+     else if (STRLEN(initdir) + 2 < MAXPATHL)
+  STRCPY(dirbuf, initdir);
+     else
+  dirbuf[0] = NUL;
+     if (dflt != NULL && *dflt != NUL
+ 			      && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
+     {
+  add_pathsep(dirbuf);
+  STRCAT(dirbuf, dflt);
+     }

       /* Position the file selector just below the menubar */
       XtTranslateCoords(vimShell, (Position)0, (Position)
***************
*** 1845,1851 ****
  	     0
   #endif
  	     , &x, &y);
!     return (char_u *)vim_SelFile(vimShell, (char *)title, (char *)initdir,
  		   NULL, (int)x, (int)y, gui.menu_fg_pixel, gui.menu_bg_pixel);
   }
   #endif
--- 1860,1866 ----
  	     0
   #endif
  	     , &x, &y);
!     return (char_u *)vim_SelFile(vimShell, (char *)title, (char *)dirbuf,
  		   NULL, (int)x, (int)y, gui.menu_fg_pixel, gui.menu_bg_pixel);
   }
   #endif
*** ../vim60.162/src/gui_gtk.c Fri Dec 14 20:19:45 2001
--- src/gui_gtk.c Sun Feb  3 15:25:14 2002
***************
*** 875,890 ****
       /* if our pointer is currently hidden, then we should show it. */
       gui_mch_mousehide(FALSE);

!     if (dflt == NULL)
!  dflt = (char_u *)"";
       if (initdir == NULL || *initdir == NUL)
-     {
  	 mch_dirname(dirbuf, MAXPATHL);
!  strcat((char *)dirbuf, "/"); /* make sure this is a directory */
!  initdir = dirbuf;
!     }
       gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
! 						      (const gchar *)initdir);

       gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
  				        GTK_WIDGET(gui.filedlg), VW_POS_MOUSE);
--- 875,895 ----
       /* if our pointer is currently hidden, then we should show it. */
       gui_mch_mousehide(FALSE);

!     /* Concatenate "initdir" and "dflt". */
       if (initdir == NULL || *initdir == NUL)
  	 mch_dirname(dirbuf, MAXPATHL);
!     else if (STRLEN(initdir) + 2 < MAXPATHL)
!  STRCPY(dirbuf, initdir);
!     else
!  dirbuf[0] = NUL;
!     /* Always need a trailing slash for a directory. */
!     add_pathsep(dirbuf);
!     if (dflt != NULL && *dflt != NUL
! 			      && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
!  STRCAT(dirbuf, dflt);
!
       gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
! 						      (const gchar *)dirbuf);

       gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
  				        GTK_WIDGET(gui.filedlg), VW_POS_MOUSE);
***************
*** 900,906 ****

   #endif /* FEAT_BROWSE */

! #ifdef FEAT_GUI_DIALOG

   static char_u *dialog_textfield = NULL;
   static GtkWidget *dialog_textentry;
--- 905,911 ----

   #endif /* FEAT_BROWSE */

! #if defined(FEAT_GUI_DIALOG) || defined(PROTO)

   static char_u *dialog_textfield = NULL;
   static GtkWidget *dialog_textentry;
*** ../vim60.162/src/gui_motif.c Wed Sep 26 16:47:48 2001
--- src/gui_motif.c Sun Feb  3 14:23:53 2002
***************
*** 1531,1537 ****

       str = XmStringCreate(new_label, STRING_TAG);

!     if (str) {
  	 XtVaSetValues(w, XmNlabelString, str, NULL);
  	 XmStringFree(str);
       }
--- 1531,1538 ----

       str = XmStringCreate(new_label, STRING_TAG);

!     if (str)
!     {
  	 XtVaSetValues(w, XmNlabelString, str, NULL);
  	 XmStringFree(str);
       }
***************
*** 1552,1568 ****
       char_u *filter; /* file name filter */
   {
       char_u dirbuf[MAXPATHL];
       char_u *pattern;
       char_u *tofree = NULL;

       dialog_wgt = XmCreateFileSelectionDialog(vimShell, (char *)title, NULL,
0);

-     if (dflt == NULL)
-  dflt = (char_u *)"";
       if (initdir == NULL || *initdir == NUL)
       {
  	 mch_dirname(dirbuf, MAXPATHL);
  	 initdir = dirbuf;
       }

       /* Can only use one pattern for a file name.  Get the first pattern out of
--- 1553,1580 ----
       char_u *filter; /* file name filter */
   {
       char_u dirbuf[MAXPATHL];
+     char_u dfltbuf[MAXPATHL];
       char_u *pattern;
       char_u *tofree = NULL;

       dialog_wgt = XmCreateFileSelectionDialog(vimShell, (char *)title, NULL,
0);

       if (initdir == NULL || *initdir == NUL)
       {
  	 mch_dirname(dirbuf, MAXPATHL);
  	 initdir = dirbuf;
+     }
+
+     if (dflt == NULL)
+  dflt = (char_u *)"";
+     else if (STRLEN(initdir) + STRLEN(dflt) + 2 < MAXPATHL)
+     {
+  /* The default selection should be the full path, "dflt" is only the
+ 	 * file name. */
+  STRCPY(dfltbuf, initdir);
+  add_pathsep(dfltbuf);
+  STRCAT(dfltbuf, dflt);
+  dflt = dfltbuf;
       }

       /* Can only use one pattern for a file name.  Get the first pattern out of
*** ../vim60.162/src/message.c Fri Sep 28 22:19:57 2001
--- src/message.c Sun Feb  3 13:42:00 2002
***************
*** 2475,2483 ****
   do_browse(saving, title, dflt, ext, initdir, filter, buf)
       int  saving;  /* write action */
       char_u *title;  /* title for the window */
!     char_u *dflt;  /* default file name */
       char_u *ext;  /* extension added */
!     char_u *initdir; /* initial directory, NULL for current dir */
       char_u *filter; /* file name filter */
       buf_T *buf;  /* buffer to read/write for */
   {
--- 2475,2484 ----
   do_browse(saving, title, dflt, ext, initdir, filter, buf)
       int  saving;  /* write action */
       char_u *title;  /* title for the window */
!     char_u *dflt;  /* default file name (may include directory) */
       char_u *ext;  /* extension added */
!     char_u *initdir; /* initial directory, NULL for current dir or
! 				   when using path from "dflt" */
       char_u *filter; /* file name filter */
       buf_T *buf;  /* buffer to read/write for */
   {
***************
*** 2498,2505 ****
  	     title = (char_u *)_("Open File dialog");
       }

!     /* When no directory specified, use default dir, buffer dir, last dir
!      * or current dir */
       if (initdir == NULL || *initdir == NUL)
       {
  	 /* When 'browsedir' is a directory, use it */
--- 2499,2525 ----
  	     title = (char_u *)_("Open File dialog");
       }

!     /* When no directory specified, use default file name, default dir, buffer
!      * dir, last dir or current dir */
!     if ((initdir == NULL || *initdir == NUL) && dflt != NULL && *dflt != NUL)
!     {
!  if (mch_isdir(dflt))  /* default file name is a directory */
!  {
! 	    initdir = dflt;
! 	    dflt = NULL;
!  }
!  else if (gettail(dflt) != dflt) /* default file name includes a path */
!  {
! 	    tofree = vim_strsave(dflt);
! 	    if (tofree != NULL)
! 	    {
! 	 initdir = tofree;
! 	 *gettail(initdir) = NUL;
! 	 dflt = gettail(dflt);
! 	    }
!  }
!     }
!
       if (initdir == NULL || *initdir == NUL)
       {
  	 /* When 'browsedir' is a directory, use it */
***************
*** 2509,2515 ****
  	 else if ((saving || *p_bsdir == 'b')
  		 && buf != NULL && buf->b_ffname != NULL)
  	 {
! 	    dflt = gettail(curbuf->b_ffname);
  	     tofree = vim_strsave(curbuf->b_ffname);
  	     if (tofree != NULL)
  	     {
--- 2529,2536 ----
  	 else if ((saving || *p_bsdir == 'b')
  		 && buf != NULL && buf->b_ffname != NULL)
  	 {
! 	    if (dflt == NULL || *dflt == NUL)
! 	 dflt = gettail(curbuf->b_ffname);
  	     tofree = vim_strsave(curbuf->b_ffname);
  	     if (tofree != NULL)
  	     {
***************
*** 2560,2566 ****
  	     *gettail(last_dir) = NUL;
  	     if (*last_dir == NUL)
  	     {
! 	 /* filename only returned, must be in current dir*/
  		 vim_free(last_dir);
  		 last_dir = alloc(MAXPATHL);
  		 if (last_dir != NULL)
--- 2581,2587 ----
  	     *gettail(last_dir) = NUL;
  	     if (*last_dir == NUL)
  	     {
! 	 /* filename only returned, must be in current dir */
  		 vim_free(last_dir);
  		 last_dir = alloc(MAXPATHL);
  		 if (last_dir != NULL)
*** ../vim60.162/src/version.c Sun Feb  3 12:42:13 2002
--- src/version.c Sun Feb  3 15:16:22 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     163,
   /**/

--
hundred-and-one symptoms of being an internet addict:
168. You have your own domain name.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27072 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 2:45 pm
Subject: Re: can't paste using GUI
Bram@...
Send Email Send Email
 
Muraoka Taro wrote:

> Vim can't paste any text using GUI in insert and visual mode.
> GUI events are mapped by using *noremenu, it should be *menu.
> Please check attached patch.

Good point.  But using <script> is a better solution.  I'll make a patch
for that.

--
"Hit any key to continue" does _not_ mean you can hit the on/off button!

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27073 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 2:45 pm
Subject: Patch 6.0.164
Bram@...
Send Email Send Email
 
Patch 6.0.164
Problem:    After patch 6.0.135 the menu entries for pasting don't work in
	     Insert and Visual mode. (Muraoka Taro)
Solution:   Add <script> to allow script-local mappings.
Files:     runtime/menu.vim


*** ../vim60.163/runtime/menu.vim Mon Jan 28 16:11:30 2002
--- runtime/menu.vim Sun Feb  3 15:35:55 2002
***************
*** 121,127 ****
   " Visual mode without the +virtualedit feature.  They are pasted as if they
   " were characterwise instead.
   if has("virtualedit")
!   nnoremap <silent> <SID>Paste :call <SID>Paste()<CR>
     func! <SID>Paste()
       let ove = &ve
       set ve=all
--- 121,127 ----
   " Visual mode without the +virtualedit feature.  They are pasted as if they
   " were characterwise instead.
   if has("virtualedit")
!   nnoremap <silent> <script> <SID>Paste :call <SID>Paste()<CR>
     func! <SID>Paste()
       let ove = &ve
       set ve=all
***************
*** 129,135 ****
       let &ve = ove
     endfunc
   else
!   nnoremap <silent> <SID>Paste "=@+.'xy'<CR>gPFx"_2x
   endif

   " Edit menu
--- 129,135 ----
       let &ve = ove
     endfunc
   else
!   nnoremap <silent> <script> <SID>Paste "=@+.'xy'<CR>gPFx"_2x
   endif

   " Edit menu
***************
*** 144,154 ****
   nnoremenu 20.360 &Edit.&Paste<Tab>"+P  "+gP
   cnoremenu  &Edit.&Paste<Tab>"+P  <C-R>+
   if has("virtualedit")
!   vnoremenu  &Edit.&Paste<Tab>"+P  "-c<Esc><SID>Paste
!   inoremenu  &Edit.&Paste<Tab>"+P  <Esc><SID>Pastegi
   else
!   vnoremenu  &Edit.&Paste<Tab>"+P  "-c<Esc>gix<Esc><SID>Paste"_x
!   inoremenu  &Edit.&Paste<Tab>"+P  x<Esc><SID>Paste"_s
   endif
   nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
   inoremenu  &Edit.Put\ &Before<Tab>[p <C-O>[p
--- 144,154 ----
   nnoremenu 20.360 &Edit.&Paste<Tab>"+P  "+gP
   cnoremenu  &Edit.&Paste<Tab>"+P  <C-R>+
   if has("virtualedit")
!   vnoremenu <script>  &Edit.&Paste<Tab>"+P "-c<Esc><SID>Paste
!   inoremenu <script>  &Edit.&Paste<Tab>"+P <Esc><SID>Pastegi
   else
!   vnoremenu <script>  &Edit.&Paste<Tab>"+P "-c<Esc>gix<Esc><SID>Paste"_x
!   inoremenu <script>  &Edit.&Paste<Tab>"+P x<Esc><SID>Paste"_s
   endif
   nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
   inoremenu  &Edit.Put\ &Before<Tab>[p <C-O>[p
***************
*** 732,742 ****
   nnoremenu 1.40 PopUp.&Paste  "+gP
   cnoremenu 1.40 PopUp.&Paste  <C-R>+
   if has("virtualedit")
!   vnoremenu 1.40 PopUp.&Paste  "-c<Esc><SID>Paste
!   inoremenu 1.40 PopUp.&Paste  <Esc><SID>Pastegi
   else
!   vnoremenu 1.40 PopUp.&Paste  "-c<Esc>gix<Esc><SID>Paste"_x
!   inoremenu 1.40 PopUp.&Paste  x<Esc><SID>Paste"_s
   endif
   vnoremenu 1.50 PopUp.&Delete  x
   an 1.55 PopUp.-SEP2- 	 <Nop>
--- 732,742 ----
   nnoremenu 1.40 PopUp.&Paste  "+gP
   cnoremenu 1.40 PopUp.&Paste  <C-R>+
   if has("virtualedit")
!   vnoremenu <script> 1.40 PopUp.&Paste "-c<Esc><SID>Paste
!   inoremenu <script> 1.40 PopUp.&Paste <Esc><SID>Pastegi
   else
!   vnoremenu <script> 1.40 PopUp.&Paste "-c<Esc>gix<Esc><SID>Paste"_x
!   inoremenu <script> 1.40 PopUp.&Paste x<Esc><SID>Paste"_s
   endif
   vnoremenu 1.50 PopUp.&Delete  x
   an 1.55 PopUp.-SEP2- 	 <Nop>
***************
*** 773,783 ****
     nnoremenu 1.90 ToolBar.Paste  "+gP
     cnoremenu  ToolBar.Paste  <C-R>+
     if has("virtualedit")
!     vnoremenu  ToolBar.Paste  "-c<Esc><SID>Paste
!     inoremenu  ToolBar.Paste  <Esc><SID>Pastegi
     else
!     vnoremenu  ToolBar.Paste  "-c<Esc>gix<Esc><SID>Paste"_x
!     inoremenu  ToolBar.Paste  x<Esc><SID>Paste"_s
     endif

     if !has("gui_athena")
--- 773,783 ----
     nnoremenu 1.90 ToolBar.Paste  "+gP
     cnoremenu  ToolBar.Paste  <C-R>+
     if has("virtualedit")
!     vnoremenu <script>  ToolBar.Paste "-c<Esc><SID>Paste
!     inoremenu <script>  ToolBar.Paste <Esc><SID>Pastegi
     else
!     vnoremenu <script>  ToolBar.Paste "-c<Esc>gix<Esc><SID>Paste"_x
!     inoremenu <script>  ToolBar.Paste x<Esc><SID>Paste"_s
     endif

     if !has("gui_athena")
*** ../vim60.163/src/version.c Sun Feb  3 15:27:26 2002
--- src/version.c Sun Feb  3 15:39:07 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     164,
   /**/

--
"Hit any key to continue" is very confusing when you have two keyboards.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27074 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 3:32 pm
Subject: Patch 6.0.165
Bram@...
Send Email Send Email
 
Patch 6.0.165
Problem:    Using --remote and executing locally gives unavoidable error
	     messages.
Solution:   Add --remote-silent and --remote-wait-silent to silently execute
	     locally.
	     For Win32 there was no error message when a server didn't exist.
Files:     src/eval.c, src/if_xcmdsrv.c, src/main.c, src/os_mswin.c,
	     src/proto/if_xcmdsrv.pro, src/proto/os_mswin.pro


*** ../vim60.164/src/eval.c Wed Jan  9 16:29:27 2002
--- src/eval.c Sun Feb  3 16:19:57 2002
***************
*** 5662,5673 ****
       server_name = get_var_string(&argvars[0]);
       keys = get_var_string_buf(&argvars[1], buf);
   # ifdef WIN32
!     if (serverSendToVim(server_name, keys, &r, &w, expr) < 0)
   # else
!     if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, 0) < 0)
   # endif
       {
!  EMSG2(_("E241: Unable to send to %s"), server_name);
  	 return;
       }

--- 5662,5677 ----
       server_name = get_var_string(&argvars[0]);
       keys = get_var_string_buf(&argvars[1], buf);
   # ifdef WIN32
!     if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0)
   # else
!     if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, 0, TRUE)
! 									  < 0)
   # endif
       {
!  if (r != NULL)
! 	    EMSG(r);  /* sending worked but evaluation failed */
!  else
! 	    EMSG2(_("E241: Unable to send to %s"), server_name);
  	 return;
       }

*** ../vim60.164/src/if_xcmdsrv.c Sun Feb  3 12:42:13 2002
--- src/if_xcmdsrv.c Sun Feb  3 16:13:20 2002
***************
*** 348,354 ****
    * Returns 0 for OK, negative for an error.
    */
       int
! serverSendToVim(dpy, name, cmd,  result, server, asExpr, localLoop)
       Display *dpy; 	 /* Where to send. */
       char_u *name; 	 /* Where to send. */
       char_u *cmd; 	 /* What to send. */
--- 348,354 ----
    * Returns 0 for OK, negative for an error.
    */
       int
! serverSendToVim(dpy, name, cmd,  result, server, asExpr, localLoop, silent)
       Display *dpy; 	 /* Where to send. */
       char_u *name; 	 /* Where to send. */
       char_u *cmd; 	 /* What to send. */
***************
*** 356,361 ****
--- 356,362 ----
       Window *server;  /* Actual ID of receiving app */
       Bool asExpr; 	 /* Interpret as keystrokes or expr ? */
       Bool localLoop;  /* Throw away everything but result */
+     int  silent; 	 /* don't complain about no server */
   {
       Window     w;
       char_u     *property;
***************
*** 429,435 ****
       }
       if (w == None)
       {
!  EMSG2(_("E247: no registered server named \"%s\""), name);
  	 return -1;
       }
       else if (loosename != NULL)
--- 430,437 ----
       }
       if (w == None)
       {
!  if (!silent)
! 	    EMSG2(_("E247: no registered server named \"%s\""), name);
  	 return -1;
       }
       else if (loosename != NULL)
*** ../vim60.164/src/main.c Sun Feb  3 12:42:13 2002
--- src/main.c Sun Feb  3 16:20:19 2002
***************
*** 264,272 ****
  	 else if (STRICMP(argv[i], "--serverlist") == 0
  		  || STRICMP(argv[i], "--remote-send") == 0
  		  || STRICMP(argv[i], "--remote-expr") == 0
! 		 || STRICMP(argv[i], "--remote") == 0 )
  	     serverArg = TRUE;
!  else if (STRICMP(argv[i], "--remote-wait") == 0)
  	 {
  	     serverArg = TRUE;
   #ifdef FEAT_GUI
--- 264,274 ----
  	 else if (STRICMP(argv[i], "--serverlist") == 0
  		  || STRICMP(argv[i], "--remote-send") == 0
  		  || STRICMP(argv[i], "--remote-expr") == 0
! 		 || STRICMP(argv[i], "--remote") == 0
! 		 || STRICMP(argv[i], "--remote-silent") == 0)
  	     serverArg = TRUE;
!  else if (STRICMP(argv[i], "--remote-wait") == 0
! 	 || STRICMP(argv[i], "--remote-wait-silent") == 0)
  	 {
  	     serverArg = TRUE;
   #ifdef FEAT_GUI
***************
*** 2514,2519 ****
--- 2516,2522 ----
   #define ARGTYPE_EDIT  1
   #define ARGTYPE_EDIT_WAIT 2
   #define ARGTYPE_SEND  3
+     int  silent = FALSE;
   # ifndef FEAT_X11
       HWND srv;
   # else
***************
*** 2549,2556 ****
--- 2552,2569 ----

  	     if (STRICMP(argv[i], "--remote") == 0)
  		 argtype = ARGTYPE_EDIT;
+ 	    else if (STRICMP(argv[i], "--remote-silent") == 0)
+ 	    {
+ 	 argtype = ARGTYPE_EDIT;
+ 	 silent = TRUE;
+ 	    }
  	     else if (STRICMP(argv[i], "--remote-wait") == 0)
  		 argtype = ARGTYPE_EDIT_WAIT;
+ 	    else if (STRICMP(argv[i], "--remote-wait-silent") == 0)
+ 	    {
+ 	 argtype = ARGTYPE_EDIT_WAIT;
+ 	 silent = TRUE;
+ 	    }
  	     else if (STRICMP(argv[i], "--remote-send") == 0)
  		 argtype = ARGTYPE_SEND;
  	     else
***************
*** 2572,2580 ****
  		 }
   # ifdef FEAT_X11
  		 ret = serverSendToVim(xterm_dpy, sname, *serverStr,
! 							    NULL, &srv, 0, 0);
   # else
! 	 ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0);
   # endif
  		 if (ret < 0)
  		 {
--- 2585,2593 ----
  		 }
   # ifdef FEAT_X11
  		 ret = serverSendToVim(xterm_dpy, sname, *serverStr,
! 						    NULL, &srv, 0, 0, silent);
   # else
! 	 ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0, silent);
   # endif
  		 if (ret < 0)
  		 {
***************
*** 2584,2590 ****
  			 mch_errmsg(_("\nSend failed.\n"));
  			 didone = TRUE;
  		     }
! 		    else
  			 /* Let vim start normally.  */
  			 mch_errmsg(_("\nSend failed. Trying to execute locally\n"));
  		     break;
--- 2597,2603 ----
  			 mch_errmsg(_("\nSend failed.\n"));
  			 didone = TRUE;
  		     }
! 		    else if (!silent)
  			 /* Let vim start normally.  */
  			 mch_errmsg(_("\nSend failed. Trying to execute locally\n"));
  		     break;
***************
*** 2658,2667 ****
  		     mainerr_arg_missing((char_u *)argv[i]);
   # ifdef WIN32
  		 if (serverSendToVim(sname, (char_u *)argv[i + 1],
! 						 &res, NULL, 1) < 0)
   # else
  		 if (serverSendToVim(xterm_dpy, sname, (char_u *)argv[i + 1],
! 						 &res, NULL, 1, 1) < 0)
   # endif
  		     mch_errmsg(_("Send expression failed.\n"));
  	     }
--- 2671,2680 ----
  		     mainerr_arg_missing((char_u *)argv[i]);
   # ifdef WIN32
  		 if (serverSendToVim(sname, (char_u *)argv[i + 1],
! 						    &res, NULL, 1, FALSE) < 0)
   # else
  		 if (serverSendToVim(xterm_dpy, sname, (char_u *)argv[i + 1],
! 						 &res, NULL, 1, 1, FALSE) < 0)
   # endif
  		     mch_errmsg(_("Send expression failed.\n"));
  	     }
*** ../vim60.164/src/os_mswin.c Sun Feb  3 12:42:13 2002
--- src/os_mswin.c Sun Feb  3 16:18:50 2002
***************
*** 2072,2088 ****
   }

       int
! serverSendToVim(name, cmd, result, ptarget, asExpr)
       char_u  *name; 	 /* Where to send. */
       char_u  *cmd; 	 /* What to send. */
       char_u  **result;  /* Result of eval'ed expression */
       void  *ptarget;  /* HWND of server */
       int 	 asExpr;  /* Expression or keys? */
   {
       HWND target = findServer(name);
       COPYDATASTRUCT data;
       char_u *retval = NULL;
       int  retcode = 0;

       if (ptarget)
  	 *(HWND *)ptarget = target;
--- 2072,2096 ----
   }

       int
! serverSendToVim(name, cmd, result, ptarget, asExpr, silent)
       char_u  *name; 	 /* Where to send. */
       char_u  *cmd; 	 /* What to send. */
       char_u  **result;  /* Result of eval'ed expression */
       void  *ptarget;  /* HWND of server */
       int 	 asExpr;  /* Expression or keys? */
+     int 	 silent;  /* don't complain about no server */
   {
       HWND target = findServer(name);
       COPYDATASTRUCT data;
       char_u *retval = NULL;
       int  retcode = 0;
+
+     if (target == 0)
+     {
+  if (!silent)
+ 	    EMSG2(_("E247: no registered server named \"%s\""), name);
+  return -1;
+     }

       if (ptarget)
  	 *(HWND *)ptarget = target;
*** ../vim60.164/src/proto/if_xcmdsrv.pro Tue Sep 25 21:49:16 2001
--- src/proto/if_xcmdsrv.pro Sun Feb  3 16:21:38 2002
***************
*** 1,7 ****
   /* if_xcmdsrv.c */
   int serverRegisterName __ARGS((Display *dpy, char_u *name));
   void serverChangeRegisteredWindow __ARGS((Display *dpy, Window newwin));
! int serverSendToVim __ARGS((Display *dpy, char_u *name, char_u *cmd, char_u
**result, Window *server, int asExpr, int localLoop));
   char_u *serverGetVimNames __ARGS((Display *dpy));
   Window serverStrToWin __ARGS((char_u *str));
   int serverSendReply __ARGS((char_u *name, char_u *str));
--- 1,7 ----
   /* if_xcmdsrv.c */
   int serverRegisterName __ARGS((Display *dpy, char_u *name));
   void serverChangeRegisteredWindow __ARGS((Display *dpy, Window newwin));
! int serverSendToVim __ARGS((Display *dpy, char_u *name, char_u *cmd, char_u
**result, Window *server, int asExpr, int localLoop, int silent));
   char_u *serverGetVimNames __ARGS((Display *dpy));
   Window serverStrToWin __ARGS((char_u *str));
   int serverSendReply __ARGS((char_u *name, char_u *str));
*** ../vim60.164/src/proto/os_mswin.pro Sun Feb  3 12:42:13 2002
--- src/proto/os_mswin.pro Sun Feb  3 16:21:43 2002
***************
*** 45,51 ****
   void serverSetName __ARGS((char_u *name));
   char_u *serverGetVimNames __ARGS((void));
   int serverSendReply __ARGS((char_u *name, char_u *reply));
! int serverSendToVim __ARGS((char_u *name, char_u *cmd, char_u **result, void
*ptarget, int asExpr));
   void serverForeground __ARGS((char_u *name));
   char_u *serverGetReply __ARGS((HWND server, int *expr_res, int remove, int
wait));
   void serverProcessPendingMessages __ARGS((void));
--- 45,51 ----
   void serverSetName __ARGS((char_u *name));
   char_u *serverGetVimNames __ARGS((void));
   int serverSendReply __ARGS((char_u *name, char_u *reply));
! int serverSendToVim __ARGS((char_u *name, char_u *cmd, char_u **result, void
*ptarget, int asExpr, int silent));
   void serverForeground __ARGS((char_u *name));
   char_u *serverGetReply __ARGS((HWND server, int *expr_res, int remove, int
wait));
   void serverProcessPendingMessages __ARGS((void));
*** ../vim60.164/src/version.c Sun Feb  3 15:45:39 2002
--- src/version.c Sun Feb  3 16:25:52 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     165,
   /**/

--
"Hit any key to continue" it said, but nothing happened after F sharp.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27075 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 4:14 pm
Subject: Patch 6.0.166
Bram@...
Send Email Send Email
 
Patch 6.0.166
Problem:    GUI: There is no way to avoid dialogs to pop up.
Solution:   Add the 'c' flag to 'guioptions': Use console dialogs.  (Yegappan
	     Lakshmanan)
Files:     runtime/doc/options.txt, src/option.h, src/message.c


*** ../vim60.165/runtime/doc/options.txt Wed Sep 26 13:46:46 2001
--- runtime/doc/options.txt Sun Feb  3 17:04:47 2002
***************
*** 2652,2657 ****
--- 2655,2662 ----
  			  "A" 	 - 	 yes
  			  "aA"  yes 	 yes

+ 	  'c' Use console dialogs instead of popup dialogs for simple
+ 	 choices.
  	   'f' Foreground: Don't use fork() to detach the GUI from the shell
  		 where it was started.  Use this for programs that wait for the
  		 editor to finish (e.g., an e-mail program).  Alternatively you
*** ../vim60.165/src/option.h Sat Dec 15 21:39:19 2001
--- src/option.h Sun Feb  3 17:01:12 2002
***************
*** 191,196 ****
--- 191,197 ----
   #define GO_ASEL  'a'  /* autoselect */
   #define GO_ASELML 'A'  /* autoselect modeless selection */
   #define GO_BOT  'b'  /* use bottom scrollbar */
+ #define GO_CONDIALOG 'c'  /* use console dialog */
   #define GO_FORG  'f'  /* start GUI in foreground */
   #define GO_GREY  'g'  /* use grey menu items */
   #define GO_ICON  'i'  /* use Vim icon */
***************
*** 205,211 ****
   #define GO_TOOLBAR 'T'  /* add toolbar */
   #define GO_FOOTER 'F'  /* add footer */
   #define GO_VERTICAL 'v'  /* arrange dialog buttons vertically */
! #define GO_ALL  "aAbfFgilmMprtTv" /* all possible flags for 'go' */

   /* flags for 'comments' option */
   #define COM_NEST 'n'  /* comments strings nest */
--- 206,212 ----
   #define GO_TOOLBAR 'T'  /* add toolbar */
   #define GO_FOOTER 'F'  /* add footer */
   #define GO_VERTICAL 'v'  /* arrange dialog buttons vertically */
! #define GO_ALL  "aAbcfFgilmMprtTv" /* all possible flags for 'go' */

   /* flags for 'comments' option */
   #define COM_NEST 'n'  /* comments strings nest */
*** ../vim60.165/src/message.c Sun Feb  3 15:27:26 2002
--- src/message.c Sun Feb  3 17:03:37 2002
***************
*** 2212,2219 ****
   #endif

   #ifdef FEAT_GUI_DIALOG
!     /* When GUI is running, use the GUI dialog */
!     if (gui.in_use)
       {
  	 c = gui_mch_dialog(type, title, message, buttons, dfltbutton,
  								    textfield);
--- 2212,2219 ----
   #endif

   #ifdef FEAT_GUI_DIALOG
!     /* When GUI is running and 'c' not in 'guioptions', use the GUI dialog */
!     if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL)
       {
  	 c = gui_mch_dialog(type, title, message, buttons, dfltbutton,
  								    textfield);
*** ../vim60.165/src/version.c Sun Feb  3 16:32:18 2002
--- src/version.c Sun Feb  3 17:07:51 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     166,
   /**/

--
"Hit any key to continue" is a lie.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27076 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 4:33 pm
Subject: Patch 6.0.167
Bram@...
Send Email Send Email
 
Patch 6.0.167
Problem:    When 'fileencodings' is "latin2" some characters in the help files
             are displayed wrong.
Solution:   Force the 'fileencoding' for the help files to be "latin1".
Files:      src/fileio.c


*** ../vim60.166/src/fileio.c Wed Jan 30 20:11:50 2002
--- src/fileio.c Sun Feb  3 17:27:17 2002
***************
*** 670,676 ****
       /*
        * Decide which 'encoding' to use first.
        */
!     if (eap != NULL && eap->force_enc != 0)
       {
  	 fenc = enc_canonize(eap->cmd + eap->force_enc);
  	 fenc_alloced = TRUE;
--- 674,685 ----
       /*
        * Decide which 'encoding' to use first.
        */
!     if (curbuf->b_help)
!     {
!  fenc = (char_u *)"latin1"; /* help files are latin1 */
!  fenc_alloced = FALSE;
!     }
!     else if (eap != NULL && eap->force_enc != 0)
       {
  	 fenc = enc_canonize(eap->cmd + eap->force_enc);
  	 fenc_alloced = TRUE;
*** ../vim60.166/src/version.c Sun Feb  3 17:31:23 2002
--- src/version.c Sun Feb  3 17:30:56 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     167,
   /**/

--
Did you ever see a "Hit any key to continue" message in a music piece?

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27077 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 4:55 pm
Subject: Patch 6.0.168
Bram@...
Send Email Send Email
 
Patch 6.0.168
Problem:    ":%s/\n/#/" doesn't replace at an empty line. (Bruce DeVisser)
Solution:   Don't skip matches after joining two lines.
Files:      src/ex_cmds.c


*** ../vim60.167/src/ex_cmds.c Sun Feb  3 15:27:26 2002
--- src/ex_cmds.c Sun Feb  3 17:49:34 2002
***************
*** 3937,3947 ****
  		  * 4. If do_all is set, find next match.
  		  * Prevent endless loop with patterns that match empty
  		  * strings, e.g. :s/$/pat/g or :s/[a-z]* /(&)/g.
  		  */
   skip:
! 	 nmatch = -1;
! 	 lastone = (sub_firstline[matchcol] == NUL
  			      || got_int || got_quit || !(do_all || do_again));
  		 if (lastone
  			 || do_ask
  			 || (nmatch = vim_regexec_multi(®match, curwin,
--- 3937,3948 ----
  		  * 4. If do_all is set, find next match.
  		  * Prevent endless loop with patterns that match empty
  		  * strings, e.g. :s/$/pat/g or :s/[a-z]* /(&)/g.
+ 		 * But ":s/\n/#/" is OK.
  		  */
   skip:
! 	 lastone = ((sub_firstline[matchcol] == NUL && nmatch <= 1)
  			      || got_int || got_quit || !(do_all || do_again));
+ 	 nmatch = -1;
  		 if (lastone
  			 || do_ask
  			 || (nmatch = vim_regexec_multi(®match, curwin,
*** ../vim60.167/src/version.c Sun Feb  3 17:33:39 2002
--- src/version.c Sun Feb  3 17:53:11 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     168,
   /**/

--
In Joseph Heller's novel "Catch-22", the main character tries to get out of a
war by proving he is crazy.  But the mere fact he wants to get out of the war
only shows he isn't crazy -- creating the original "Catch-22".

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27078 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 5:52 pm
Subject: Patch 6.0.169
Bram@...
Send Email Send Email
 
Patch 6.0.169
Problem:    When run as evim and the GUI can't be started we get stuck in a
             terminal without menus in Insert mode.
Solution:   Exit when using "evim" and "gvim -y" when the GUI can't be
             started.
Files:      src/main.c


*** ../vim60.168/src/main.c Sun Feb  3 16:32:18 2002
--- src/main.c Sun Feb  3 18:49:33 2002
***************
*** 994,1000 ****
--- 994,1007 ----
        * Don't know about other systems, stay on the safe side and don't check.
        */
       if (gui.starting && gui_init_check() == FAIL)
+     {
  	 gui.starting = FALSE;
+
+  /* When running "evim" or "gvim -y" we need the menus, exit if we
+ 	 * don't have them. */
+  if (evim_mode)
+ 	    mch_exit(1);
+     }
   # endif
   #endif

***************
*** 1373,1378 ****
--- 1380,1390 ----

  	 gui_start();  /* will set full_screen to TRUE */
  	 TIME_MSG("starting GUI");
+
+  /* When running "evim" or "gvim -y" we need the menus, exit if we
+ 	 * don't have them. */
+  if (!gui.in_use && evim_mode)
+ 	    mch_exit(1);
       }
   #endif

*** ../vim60.168/src/version.c Sun Feb  3 17:55:07 2002
--- src/version.c Sun Feb  3 18:49:53 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     169,
   /**/

--
hundred-and-one symptoms of being an internet addict:
169. You hire a housekeeper for your home page.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27079 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 7:45 pm
Subject: Patch to try out
Bram@...
Send Email Send Email
 
This patch should get a better value for 'maxmemtot'.  Previously it
used the limit for user data, which may be much too high.  This may
result in a lot of swapping when editing huge files.

This patch checks for the existence of the sysctl() and sysinfo()
functions.  sysctl() is supposed to be present on BSD systems and
sysinfo() in Linux.  But they might be present on other systems in an
incompatible way.  That's why this needs to be checked on various
Unix-like systems.

Let me know if this patch causes problems on your system.  Watch the
resulting value of 'maxmemtot'.


*** ../vim60.169/src/auto/configure Fri Feb  1 20:29:26 2002
--- src/auto/configure Sun Feb  3 20:14:20 2002
***************
*** 4698,4718 ****
  	 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
  	 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
  	 libgen.h util/debug.h util/msg18n.h frame.h \
!  sys/acl.h sys/access.h
   do
   ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4682: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
     echo $ac_n "(cached) $ac_c" 1>&6
   else
     cat > conftest.$ac_ext <<EOF
! #line 4687 "configure"
   #include "confdefs.h"
   #include <$ac_hdr>
   EOF
   ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
   ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
   if test -z "$ac_err"; then
     rm -rf conftest*
--- 4698,4718 ----
  	 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
  	 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
  	 libgen.h util/debug.h util/msg18n.h frame.h \
!  sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h
   do
   ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4706: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
     echo $ac_n "(cached) $ac_c" 1>&6
   else
     cat > conftest.$ac_ext <<EOF
! #line 4711 "configure"
   #include "confdefs.h"
   #include <$ac_hdr>
   EOF
   ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
   ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
   if test -z "$ac_err"; then
     rm -rf conftest*
***************
*** 5823,5837 ****
  	 memset nanosleep opendir putenv qsort readlink select setenv \
  	 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  	 sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
!  strpbrk strtol tgetent usleep utime utimes
   do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:5770: checking for $ac_func" >&5
   if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
     echo $ac_n "(cached) $ac_c" 1>&6
   else
     cat > conftest.$ac_ext <<EOF
! #line 5775 "configure"
   #include "confdefs.h"
   /* System header to define __stub macros and hopefully few prototypes,
       which can conflict with char $ac_func(); below.  */
--- 5823,5837 ----
  	 memset nanosleep opendir putenv qsort readlink select setenv \
  	 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  	 sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
!  strpbrk strtol sysctl sysinfo tgetent usleep utime utimes
   do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:5830: checking for $ac_func" >&5
   if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
     echo $ac_n "(cached) $ac_c" 1>&6
   else
     cat > conftest.$ac_ext <<EOF
! #line 5835 "configure"
   #include "confdefs.h"
   /* System header to define __stub macros and hopefully few prototypes,
       which can conflict with char $ac_func(); below.  */
*** ../vim60.169/src/configure.in Fri Feb  1 20:29:26 2002
--- src/configure.in Sun Feb  3 20:09:47 2002
***************
*** 1382,1388 ****
  	 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
  	 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
  	 libgen.h util/debug.h util/msg18n.h frame.h \
!  sys/acl.h sys/access.h)

   dnl Check if strings.h and string.h can both be included when defined.
   AC_MSG_CHECKING([if strings.h can be included after string.h])
--- 1382,1388 ----
  	 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
  	 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
  	 libgen.h util/debug.h util/msg18n.h frame.h \
!  sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h)

   dnl Check if strings.h and string.h can both be included when defined.
   AC_MSG_CHECKING([if strings.h can be included after string.h])
***************
*** 1717,1723 ****
  	 memset nanosleep opendir putenv qsort readlink select setenv \
  	 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  	 sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
!  strpbrk strtol tgetent usleep utime utimes)

   dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
   AC_MSG_CHECKING(for st_blksize)
--- 1717,1723 ----
  	 memset nanosleep opendir putenv qsort readlink select setenv \
  	 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  	 sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
!  strpbrk strtol sysctl sysinfo tgetent usleep utime utimes)

   dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
   AC_MSG_CHECKING(for st_blksize)
*** ../vim60.169/src/config.h.in Tue Jan 22 15:38:17 2002
--- src/config.h.in Sun Feb  3 20:10:04 2002
***************
*** 176,181 ****
--- 176,183 ----
   #undef HAVE_STRPBRK
   #undef HAVE_STRTOL
   #undef HAVE_ST_BLKSIZE
+ #undef HAVE_SYSCTL
+ #undef HAVE_SYSINFO
   #undef HAVE_TGETENT
   #undef HAVE_USLEEP
   #undef HAVE_UTIME
***************
*** 214,219 ****
--- 216,223 ----
   #undef HAVE_SYS_SELECT_H
   #undef HAVE_SYS_STATFS_H
   #undef HAVE_SYS_STREAM_H
+ #undef HAVE_SYS_SYSCTL_H
+ #undef HAVE_SYS_SYSINFO_H
   #undef HAVE_SYS_SYSTEMINFO_H
   #undef HAVE_SYS_TIME_H
   #undef HAVE_SYS_UTSNAME_H
*** ../vim60.169/src/os_unix.c Mon Dec 31 17:47:49 2001
--- src/os_unix.c Sun Feb  3 20:14:19 2002
***************
*** 412,417 ****
--- 412,423 ----
   # ifdef HAVE_SYS_RESOURCE_H
   #  include <sys/resource.h>
   # endif
+ # ifdef HAVE_SYS_SYSCTL_H
+ #  include <sys/sysctl.h>
+ # endif
+ # ifdef HAVE_SYS_SYSINFO_H
+ #  include <sys/sysinfo.h>
+ # endif

   /*
    * Return total amount of memory available.  Doesn't change when memory has
***************
*** 425,439 ****
   # ifdef __EMX__
       return ulimit(3, 0L);   /* always 32MB? */
   # else
!     struct rlimit rlp;

!     if (getrlimit(RLIMIT_DATA, &rlp) == 0
! 	    && rlp.rlim_cur < ((rlim_t)1 << (sizeof(long_u) * 8 - 1))
   #  ifdef RLIM_INFINITY
! 	    && rlp.rlim_cur != RLIM_INFINITY
   #  endif
! 	    )
!  return (long_u)rlp.rlim_cur;
       return (long_u)0x7fffffff;
   # endif
   }
--- 431,471 ----
   # ifdef __EMX__
       return ulimit(3, 0L);   /* always 32MB? */
   # else
! #  ifdef HAVE_SYSCTL
!     {
!  int mib[2], physmem;
!  size_t len;

!  /* BSD way of getting the amount of RAM available. */
!  mib[0] = CTL_HW;
!  mib[1] = HW_USERMEM;
!  len = sizeof(physmem);
!  if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0)
! 	    return (long_u)physmem;
!     }
! #  endif
! #  if defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)
!     {
!  struct sysinfo sinfo;
!
!  /* Linux way of getting amount of RAM available */
!  if (sysinfo(&sinfo) == 0)
! 	    return sinfo.totalram;
!     }
! #  endif
! #  if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)
!     {
!  struct rlimit rlp;
!
!  if (getrlimit(RLIMIT_DATA, &rlp) == 0
! 	 && rlp.rlim_cur < ((rlim_t)1 << (sizeof(long_u) * 8 - 1))
   #  ifdef RLIM_INFINITY
! 	 && rlp.rlim_cur != RLIM_INFINITY
   #  endif
! 	   )
! 	    return (long_u)rlp.rlim_cur;
! #  endif
!     }
       return (long_u)0x7fffffff;
   # endif
   }
*** ../vim60.169/src/os_unix.h Sun Sep 30 10:50:44 2001
--- src/os_unix.h Sun Feb  3 20:12:36 2002
***************
*** 190,196 ****
   # undef __ARGS
   #endif

! #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)
   # define HAVE_TOTAL_MEM
   #endif

--- 190,198 ----
   # undef __ARGS
   #endif

! #if (defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)) \
!  || (defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)) \
!  || defined(HAVE_SYSCTL)
   # define HAVE_TOTAL_MEM
   #endif



--
hundred-and-one symptoms of being an internet addict:
170. You introduce your wife as "my_lady@..." and refer to your
      children as "forked processes."

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27080 From: Travis Hume <travis.hume@...>
Date: Sun Feb 3, 2002 8:43 pm
Subject: nasty regression
travis.hume@...
Send Email Send Email
 
Hopefully this is a problem with my setup only.  I updated from CVS this
morning to get Patch 6.0.166 "console only dialogs", rebuilt and
installed.  Now, if I edited an existing file

	 gvim ~/.zshrc

make any change then

	 :q

The modified flag (+) is set, but Vim exits immediately without
prompting me with "E37: No write since last change (use ! to override)"

This doesn't happen if a new file is edited.  It also has something to
do with my .vimrc, because

	 gvim -u NONE ~/.zshrc

works fine.  I just noticed that although it exits without prompting,
the file is being written, not abandoned.

I reckon this is some setting I have turned on, but I've never noticed
this behaviour before.  I've attached the output of :ver and my .vimrc
(small).


--
Travis Hume
Software Engineer
Tenzing Communications Inc.
travis.hume@...
:ver
VIM - Vi IMproved 6.0 (2001 Sep 26, compiled Feb  3 2002 12:15:54)
Included patches: 2, 1, 3-49, 51, 50, 52-65, 67, 66, 68-70, 72, 71, 73-86, 88, 8
7, 89-93, 97, 96, 95, 94, 99, 98, 101, 100, 102-106, 108, 107, 109-124, 126-128,
  125, 129-146, 149, 148, 147, 150-158, 160, 159, 161-169
Compiled by thume@superfast
Normal version with GTK GUI.  Features included (+) or not (-):
+autocmd -balloon_eval +browse +builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv -cscope +dialog_con_gui +diff +digraphs -ebcdic -emacs_tags +eval
+ex_extra +extra_search -farsi +file_in_path +find_in_path +folding -footer
+fork() +gettext -hangul_input -iconv +insert_expand +jumplist -keymap -langmap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
+modify_fname +mouse +mouseshape -mouse_dec +mouse_gpm -mouse_jsbterm
-mouse_netterm +mouse_xterm -multi_byte +multi_lang -osfiletype +path_extra
+perl +postscript +printer +python +quickfix -rightleft -ruby +scrollbind
-signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
+toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
+xterm_clipboard -xterm_save
    system vimrc file: "$VIM/vimrc"
      user vimrc file: "$HOME/.vimrc"
       user exrc file: "$HOME/.exrc"
   system gvimrc file: "$VIM/gvimrc"
     user gvimrc file: "$HOME/.gvimrc"
     system menu file: "$VIMRUNTIME/menu.vim"
   fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/g
tk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/u
sr/local/include  -g -O2  -I/usr/X11R6/include  -fno-strict-aliasing  -I/usr/lib
/perl5/5.6.1/i386-linux/CORE  -I/usr/include/python2.2
Linking: gcc  -L/usr/X11R6/lib  -rdynamic -Wl,-rpath,/usr/lib/perl5/5.6.1/i386-l
inux/CORE   -L/usr/local/lib -o vim   -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -r
dynamic -lgmodule -lglib -ldl -lXi -lXext -lXt -lncurses  -lgpm -ldl  -rdynamic
-Wl,-rpath,/usr/lib/perl5/5.6.1/i386-linux/CORE  -L/usr/local/lib /usr/lib/perl5
/5.6.1/i386-linux/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.6.1/i386-linux
/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -L/usr/lib/python2.2/config -lpython2
.2 -ldl -lutil -lm -Xlinker -export-dynamic
filetype plugin indent on
syn on
colorscheme my-light

set autoindent
set autowriteall
set backup
set backupdir=$HOME/tmp/.vimbackup
set backspace=indent,eol,start
set cindent
set cinkeys-=0#
set cmdheight=2
set cpoptions+=$ cpoptions-=B
set dir=$HOME/tmp/.vimswap
set expandtab
set formatoptions+=cro
set ignorecase
set incsearch
set isfname-==
set iskeyword-=-
set laststatus=2
set lazyredraw
set mousehide
set nostartofline
set scrolloff=3
set shiftwidth=4
set shortmess=atAI "s
set showcmd
set showmatch
set statusline=[%t]%=%<%r%m[line\ %l\ of\ %L,\ column\ %c]
set tabstop=4
set timeout timeoutlen=3000 ttimeoutlen=100
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
set undolevels=50
set viminfo='50,/50,:200
set visualbell t_vb=
set nowrap
set wildchar=<TAB> wildmenu wildmode=full
set writebackup

#27081 From: Bram Moolenaar <Bram@...>
Date: Sun Feb 3, 2002 9:25 pm
Subject: Re: nasty regression
Bram@...
Send Email Send Email
 
Travis Hume wrote:

> Hopefully this is a problem with my setup only.  I updated from CVS this
> morning to get Patch 6.0.166 "console only dialogs", rebuilt and
> installed.  Now, if I edited an existing file
>
>  gvim ~/.zshrc
>
> make any change then
>
>  :q
>
> The modified flag (+) is set, but Vim exits immediately without
> prompting me with "E37: No write since last change (use ! to override)"
>
> This doesn't happen if a new file is edited.  It also has something to
> do with my .vimrc, because
>
>  gvim -u NONE ~/.zshrc
>
> works fine.  I just noticed that although it exits without prompting,
> the file is being written, not abandoned.
>
> I reckon this is some setting I have turned on, but I've never noticed
> this behaviour before.  I've attached the output of :ver and my .vimrc
> (small).

This contains:

> set autowriteall

Which explains it all.

--
hundred-and-one symptoms of being an internet addict:
174. You know what a listserv is.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27082 From: Darren Hiebert <darren@...>
Date: Mon Feb 4, 2002 4:45 am
Subject: Bug in :co
darren@...
Send Email Send Email
 
There is a bug in Vim when a window is narrowed or widened with the
mouse, then resize using a ":set co=xx" command. Once a window size
is set by resizing with the mouse, it can never be resized again
with ":set co=xx", which will not actually change the window size,
but leaves Vim thinking that the window is of the commanded width.

This means that if you widen the window with a mouse, then use the
:set co command to shrink it, Vim leaves a big gray area in the
region in between the two sizes. If you narrow the window with a
mouse, then use the :set co command to widen it, Vim thinks it is
now working with a bigger area, allowing you to lose the cursor into
the invisible area lying in between the two sizes.

--
Darren Hiebert <darren@...>
http://DarrenHiebert.com

#27083 From: Zdenek Sekera <zs@...>
Date: Mon Feb 4, 2002 7:52 am
Subject: Re: Bug in :co
zs@...
Send Email Send Email
 
Darren Hiebert wrote:
>
> There is a bug in Vim when a window is narrowed or widened with the
> mouse, then resize using a ":set co=xx" command. Once a window size
> is set by resizing with the mouse, it can never be resized again
> with ":set co=xx", which will not actually change the window size,
> but leaves Vim thinking that the window is of the commanded width.
>

I can't reproduce it on my system. And more: I have *never* seen it
yet I am resizing (mouse and by a script) all the time.
This is vim 6.0.144 on IRIX.
What's your system?

---Zdenek

#27084 From: Matthew Hawkins <matt@...>
Date: Mon Feb 4, 2002 7:59 am
Subject: Re: Bug in :co
matt@...
Send Email Send Email
 
On Mon, 04 Feb 2002, Zdenek Sekera wrote:
> I can't reproduce it on my system. And more: I have *never* seen it
> yet I am resizing (mouse and by a script) all the time.
> This is vim 6.0.144 on IRIX.

I thought I had reproduced it, then realised that I was simply setting
co too small ;-)  That gave the appearance of the window not being
resized, when in fact it was sucessfully being resized to the minimum
value.

So it's working fine with gui=gnome, vim 6.0.160 on FreeBSD 4.5-STABLE
for me, also.

--
Matt

#27085 From: Zdenek Sekera <zs@...>
Date: Mon Feb 4, 2002 8:01 am
Subject: Re: Patch to try out
zs@...
Send Email Send Email
 
Bram Moolenaar wrote:
>
> This patch should get a better value for 'maxmemtot'.  Previously it
> used the limit for user data, which may be much too high.  This may
> result in a lot of swapping when editing huge files.
>
> This patch checks for the existence of the sysctl() and sysinfo()
> functions.  sysctl() is supposed to be present on BSD systems and
> sysinfo() in Linux.  But they might be present on other systems in an
> incompatible way.  That's why this needs to be checked on various
> Unix-like systems.
>

I'd like to but what's the best way to back off the patch if there
are problems? So far I have always been making a copy of the tree
and rebuilding because I didn't find a nice way to back off a patch.
And to always copy the whole release is cumbersome.

How do you do it?

---Zdenek

#27086 From: "Benoit Cerrina" <benoitcerrina@...>
Date: Mon Feb 4, 2002 8:06 am
Subject: Re: Patch to try out
benoitcerrina@...
Send Email Send Email
 
I think you can just reapply the patch your diff should tell you
that it has either already been applied or the patch is backward,
I think you can then tell diff to reapply it backward.
Benoit
----- Original Message -----
From: "Zdenek Sekera" <zs@...>
To: "Bram Moolenaar" <Bram@...>
Cc: <vim-dev@...>
Sent: Monday, February 04, 2002 9:01 AM
Subject: Re: Patch to try out


> Bram Moolenaar wrote:
> >
> > This patch should get a better value for 'maxmemtot'.  Previously it
> > used the limit for user data, which may be much too high.  This may
> > result in a lot of swapping when editing huge files.
> >
> > This patch checks for the existence of the sysctl() and sysinfo()
> > functions.  sysctl() is supposed to be present on BSD systems and
> > sysinfo() in Linux.  But they might be present on other systems in an
> > incompatible way.  That's why this needs to be checked on various
> > Unix-like systems.
> >
>
> I'd like to but what's the best way to back off the patch if there
> are problems? So far I have always been making a copy of the tree
> and rebuilding because I didn't find a nice way to back off a patch.
> And to always copy the whole release is cumbersome.
>
> How do you do it?
>
> ---Zdenek
>

#27087 From: Bram Moolenaar <Bram@...>
Date: Mon Feb 4, 2002 11:21 am
Subject: Re: Patch to try out
Bram@...
Send Email Send Email
 
Zdenek Sekera wrote:

> I'd like to but what's the best way to back off the patch if there
> are problems? So far I have always been making a copy of the tree
> and rebuilding because I didn't find a nice way to back off a patch.
> And to always copy the whole release is cumbersome.
>
> How do you do it?

To back out a patch later:

	 patch -R < patchfile

--
hundred-and-one symptoms of being an internet addict:
178. You look for an icon to double-click to open your bedroom window.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27088 From: Bram Moolenaar <Bram@...>
Date: Mon Feb 4, 2002 11:21 am
Subject: Patch 6.0.170
Bram@...
Send Email Send Email
 
Patch 6.0.170
Problem:    When printing double-width characters the size of tabs after them
	     is wrong.  (Muraoka Taro)
Solution:   Correctly compute the column after a double-width character.
Files:     src/ex_cmds2.c


*** ../vim60.169/src/ex_cmds2.c Sun Feb  3 15:27:26 2002
--- src/ex_cmds2.c Sun Feb  3 13:44:58 2002
***************
*** 3136,3142 ****
  	 else
  	 {
  	     need_break = mch_print_text_out(line + col, outputlen);
! 	    print_pos++;
  	 }
       }

--- 3136,3147 ----
  	 else
  	 {
  	     need_break = mch_print_text_out(line + col, outputlen);
! #ifdef FEAT_MBYTE
! 	    if (has_mbyte)
! 	 print_pos += (*mb_ptr2cells)(line + col);
! 	    else
! #endif
! 	 print_pos++;
  	 }
       }

*** ../vim60.169/src/version.c Sun Feb  3 19:27:27 2002
--- src/version.c Mon Feb  4 09:43:37 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     170,
   /**/

--
hundred-and-one symptoms of being an internet addict:
175. You send yourself e-mail before you go to bed to remind you
      what to do when you wake up.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27089 From: Bram Moolenaar <Bram@...>
Date: Mon Feb 4, 2002 11:21 am
Subject: Patch 6.0.171
Bram@...
Send Email Send Email
 
Patch 6.0.171
Problem:    With 'keymodel' including "startsel", in Insert mode after the end
	     of a line, shift-Left does not move the cursor. (Steve Hall)
Solution:   CTRL-O doesn't move the cursor left, need to do that explicitly.
Files:     src/edit.c


*** ../vim60.170/src/edit.c Tue Jan 15 19:48:49 2002
--- src/edit.c Mon Feb  4 10:17:59 2002
***************
*** 5763,5786 ****
  		  * CTRL-O when beyond the end of the line. */
  		 start_selection();

! 	 /* Execute the key in (insert) Select mode, unless it's
! 		 * shift-left and beyond the end of the line (the CTRL-O
! 		 * will move the cursor left already). */
  		 stuffcharReadbuff(Ctrl_O);
! 	 if (c != K_S_LEFT || gchar_cursor() != NUL)
  		 {
! 		    if (mod_mask)
! 		    {
! 		 char_u     buf[4];

! 		 buf[0] = K_SPECIAL;
! 		 buf[1] = KS_MODIFIER;
! 		 buf[2] = mod_mask;
! 		 buf[3] = NUL;
! 		 stuffReadbuff(buf);
! 		    }
! 		    stuffcharReadbuff(c);
  		 }
  		 return TRUE;
  	 }
       return FALSE;
--- 5766,5784 ----
  		  * CTRL-O when beyond the end of the line. */
  		 start_selection();

! 	 /* Execute the key in (insert) Select mode. */
  		 stuffcharReadbuff(Ctrl_O);
! 	 if (mod_mask)
  		 {
! 		    char_u     buf[4];

! 		    buf[0] = K_SPECIAL;
! 		    buf[1] = KS_MODIFIER;
! 		    buf[2] = mod_mask;
! 		    buf[3] = NUL;
! 		    stuffReadbuff(buf);
  		 }
+ 	 stuffcharReadbuff(c);
  		 return TRUE;
  	 }
       return FALSE;
*** ../vim60.170/src/version.c Mon Feb  4 09:55:08 2002
--- src/version.c Mon Feb  4 10:23:25 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     171,
   /**/

--
If Microsoft would build a car...
... the oil, water temperature, and alternator warning lights would
all be replaced by a single "General Protection Fault" warning light.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27090 From: Bram Moolenaar <Bram@...>
Date: Mon Feb 4, 2002 11:21 am
Subject: Patch 6.0.172
Bram@...
Send Email Send Email
 
Patch 6.0.172
Problem:    CTRL-Q doesn't replace CTRL-V after CTRL-X in Insert mode while it
	     does in most other situations.
Solution:   Make CTRL-X CTRL-Q work like CTRL-X CTRL-V in Insert mode.
Files:     src/edit.c


*** ../vim60.171/src/edit.c Mon Feb  4 10:26:10 2002
--- src/edit.c Mon Feb  4 10:17:59 2002
***************
*** 613,619 ****
   #endif

   #ifdef FEAT_INS_EXPAND
!  if (c == Ctrl_V && ctrl_x_mode == CTRL_X_CMDLINE)
  	     goto docomplete;
   #endif
  	 if (c == Ctrl_V || c == Ctrl_Q)
--- 613,619 ----
   #endif

   #ifdef FEAT_INS_EXPAND
!  if ((c == Ctrl_V || c == Ctrl_Q) && ctrl_x_mode == CTRL_X_CMDLINE)
  	     goto docomplete;
   #endif
  	 if (c == Ctrl_V || c == Ctrl_Q)
***************
*** 1698,1704 ****
  	     return (       c == Ctrl_X || c == Ctrl_Y || c == Ctrl_E
  		     || c == Ctrl_L || c == Ctrl_F || c == Ctrl_RSB
  		     || c == Ctrl_I || c == Ctrl_D || c == Ctrl_P
! 		    || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V);
  	 case CTRL_X_SCROLL:
  	     return (c == Ctrl_Y || c == Ctrl_E);
  	 case CTRL_X_WHOLE_LINE:
--- 1698,1705 ----
  	     return (       c == Ctrl_X || c == Ctrl_Y || c == Ctrl_E
  		     || c == Ctrl_L || c == Ctrl_F || c == Ctrl_RSB
  		     || c == Ctrl_I || c == Ctrl_D || c == Ctrl_P
! 		    || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V
! 		    || c == Ctrl_Q);
  	 case CTRL_X_SCROLL:
  	     return (c == Ctrl_Y || c == Ctrl_E);
  	 case CTRL_X_WHOLE_LINE:
***************
*** 1718,1724 ****
  	     return (c == Ctrl_D || c == Ctrl_P || c == Ctrl_N);
   #endif
  	 case CTRL_X_CMDLINE:
! 	    return (c == Ctrl_V || c == Ctrl_P || c == Ctrl_N || c == Ctrl_X);
       }
       EMSG(_(e_internal));
       return FALSE;
--- 1719,1726 ----
  	     return (c == Ctrl_D || c == Ctrl_P || c == Ctrl_N);
   #endif
  	 case CTRL_X_CMDLINE:
! 	    return (c == Ctrl_V || c == Ctrl_Q || c == Ctrl_P || c == Ctrl_N
! 		    || c == Ctrl_X);
       }
       EMSG(_(e_internal));
       return FALSE;
***************
*** 2219,2224 ****
--- 2221,2227 ----
  		 break;
   #endif
  	     case Ctrl_V:
+ 	    case Ctrl_Q:
  		 ctrl_x_mode = CTRL_X_CMDLINE;
  		 break;
  	     case Ctrl_P:
*** ../vim60.171/src/version.c Mon Feb  4 10:26:10 2002
--- src/version.c Mon Feb  4 10:29:35 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     172,
   /**/

--
If Apple would build a car...
... it would be powered by the sun, be reliable, five times
as fast and twice as easy to drive; but would only run on
five percent of the roads.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27091 From: Bram Moolenaar <Bram@...>
Date: Mon Feb 4, 2002 12:16 pm
Subject: Patch 6.0.173
Bram@...
Send Email Send Email
 
Patch 6.0.173
Problem:    When using "P" to insert a line break the cursor remains past the
	     end of the line.
Solution:   Check for the cursor being beyond the end of the line.
Files:     src/ops.c


*** ../vim60.172/src/ops.c Thu Jan 24 11:27:35 2002
--- src/ops.c Mon Feb  4 12:48:01 2002
***************
*** 3362,3370 ****
  	 if (regname == '=')
  	     vim_free(y_array);
       }
!     if ((flags & PUT_CURSEND)
! 	    && gchar_cursor() == NUL
! 	    && curwin->w_cursor.col
  	     && !(restart_edit || (State & INSERT)))
       {
  	 --curwin->w_cursor.col;
--- 3362,3369 ----
  	 if (regname == '=')
  	     vim_free(y_array);
       }
!     if (gchar_cursor() == NUL
! 	    && curwin->w_cursor.col > 0
  	     && !(restart_edit || (State & INSERT)))
       {
  	 --curwin->w_cursor.col;
*** ../vim60.172/src/version.c Mon Feb  4 10:31:31 2002
--- src/version.c Mon Feb  4 12:51:24 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     173,
   /**/

--
hundred-and-one symptoms of being an internet addict:
185. You order fast food over the Internet

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

#27092 From: Bram Moolenaar <Bram@...>
Date: Mon Feb 4, 2002 12:16 pm
Subject: Patch 6.0.174
Bram@...
Send Email Send Email
 
Patch 6.0.174
Problem:    After using "gd" or "gD" the search direction for "n" may still be
	     backwards. (Servatius Brandt)
Solution:   Reset the search direction to forward.
Files:     src/normal.c, src/search.c, src/proto/search.pro


*** ../vim60.173/src/normal.c Mon Jan 21 12:52:54 2002
--- src/normal.c Mon Feb  4 13:09:02 2002
***************
*** 3665,3670 ****
--- 3665,3672 ----
  	 if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP)
  	     foldOpenCursor();
   #endif
+  /* "n" searches forward now */
+  reset_search_dir();
       }

       vim_free(pat);
*** ../vim60.173/src/search.c Mon Nov  5 13:16:21 2001
--- src/search.c Mon Feb  4 13:08:13 2002
***************
*** 322,327 ****
--- 322,336 ----
       return spats[last_idx].pat;
   }

+ /*
+  * Reset search direction to forward.  For "gd" and "gD" commands.
+  */
+     void
+ reset_search_dir()
+ {
+     spats[0].off.dir = '/';
+ }
+
   #if defined(FEAT_EVAL) || defined(FEAT_VIMINFO)
   /*
    * Set the last search pattern.  For ":let @/ =" and viminfo.
*** ../vim60.173/src/proto/search.pro Tue Sep 25 21:49:24 2001
--- src/proto/search.pro Mon Feb  4 13:09:49 2002
***************
*** 5,10 ****
--- 5,11 ----
   void restore_search_patterns __ARGS((void));
   int ignorecase __ARGS((char_u *pat));
   char_u *last_search_pat __ARGS((void));
+ void reset_search_dir __ARGS((void));
   void set_last_search_pat __ARGS((char_u *s, int idx, int magic, int setlast));
   void last_pat_prog __ARGS((regmmatch_T *regmatch));
   int searchit __ARGS((win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *str,
long count, int options, int pat_use));
*** ../vim60.173/src/version.c Mon Feb  4 12:54:38 2002
--- src/version.c Mon Feb  4 13:13:47 2002
***************
*** 608,609 ****
--- 608,611 ----
   {   /* Add new patch number below this line */
+ /**/
+     174,
   /**/

--
hundred-and-one symptoms of being an internet addict:
186. You overstay in the office so you can have more time surfing the net.

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

Messages 27063 - 27092 of 69705   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help