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

Patch 6.1b.023
Problem:    On MS-Windows system() may cause checking timestamps, because Vim
           looses and gains input focus, while this doesn't happen on Unix.
Solution:   Don't check timestamps while system() is busy.
Files:      src/ex_cmds2.c, src/fileio.c, src/globals.h, src/misc1.c


*** ../vim61b.022/src/ex_cmds2.c        Sat Mar  2 13:01:58 2002
--- src/ex_cmds2.c      Sun Mar 17 14:14:58 2002
***************
*** 2390,2396 ****
--- 2390,2398 ----
     exarg_T   *eap;
 {
     buf_T     *buf;
+     int               save_no_check_timestamps = no_check_timestamps;

+     no_check_timestamps = 0;
     if (eap->addr_count == 0) /* default is all buffers */
       check_timestamps(FALSE);
     else
***************
*** 2399,2404 ****
--- 2401,2407 ----
       if (buf != NULL)        /* cannot happen? */
           (void)buf_check_timestamp(buf, FALSE);
     }
+     no_check_timestamps = save_no_check_timestamps;
 }
 #endif

*** ../vim61b.022/src/fileio.c  Sat Mar 16 16:18:25 2002
--- src/fileio.c        Sun Mar 17 14:13:29 2002
***************
*** 4966,4971 ****
--- 4966,4976 ----
     int               didit = 0;
     int               n;

+     /* Don't check timestamps while system() or another low-level function may
+      * cause us to lose and gain focus. */
+     if (no_check_timestamps > 0)
+       return FALSE;
+
     /* Avoid doing a check twice.  The OK/Reload dialog can cause a focus
      * event and we would keep on checking if the file is steadily growing.
      * Do check again after typing something. */
*** ../vim61b.022/src/globals.h Fri Mar 15 21:16:56 2002
--- src/globals.h       Sun Mar 17 14:10:52 2002
***************
*** 210,219 ****
--- 210,222 ----
 EXTERN colnr_T        search_match_endcol;            /* col nr of match end */

 EXTERN int    no_smartcase INIT(= FALSE);     /* don't use 'smartcase' once */
+
 EXTERN int    need_check_timestamps INIT(= FALSE); /* need to check file
                                                       timestamps asap */
 EXTERN int    did_check_timestamps INIT(= FALSE); /* did check timestamps
                                                      recently */
+ EXTERN int    no_check_timestamps INIT(= 0);  /* Don't check timestamps */
+
 EXTERN int    highlight_attr[HLF_COUNT];  /* Highl. attr for each context. */
 #ifdef FEAT_STL_OPT
 # define USER_HIGHLIGHT
*** ../vim61b.022/src/misc1.c   Sun Feb 24 15:31:30 2002
--- src/misc1.c Sun Mar 17 14:12:29 2002
***************
*** 7042,7049 ****
--- 7042,7053 ----

     /*
      * Call the shell to execute the command (errors are ignored).
+      * Don't check timestamps here.
      */
+     ++no_check_timestamps;
     call_shell(command, SHELL_DOOUT | SHELL_EXPAND | flags);
+     --no_check_timestamps;
+
     vim_free(command);

     /*
*** ../vim61b.022/src/version.c Sat Mar 16 16:44:53 2002
--- src/version.c       Sun Mar 17 14:12:44 2002
***************
*** 608,609 ****
--- 608,611 ----
 {   /* Add new patch number below this line */
+ /**/
+     23,
 /**/

--
CONCORDE:  Quickly, sir, come this way!
LAUNCELOT: No!  It's not right for my idiom.  I must escape more  ... more ...
CONCORDE:  Dramatically, sir?
LAUNCELOT: Dramatically.
                "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

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