]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-177 v7.1.177
authorBram Moolenaar <Bram@vim.org>
Tue, 1 Jan 2008 13:17:56 +0000 (13:17 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 1 Jan 2008 13:17:56 +0000 (13:17 +0000)
src/ex_cmds2.c
src/getchar.c
src/globals.h
src/version.c

index add7adb3abccd643325a8233b36c4d50aadd5156..884220ef35e0736e2f682936ad51b825a7821c0b 100644 (file)
@@ -93,6 +93,8 @@ do_debug(cmd)
     int                save_emsg_silent = emsg_silent;
     int                save_redir_off = redir_off;
     tasave_T   typeaheadbuf;
+    int                typeahead_saved = FALSE;
+    int                save_ignore_script;
 # ifdef FEAT_EX_EXTRA
     int                save_ex_normal_busy;
 # endif
@@ -159,18 +161,26 @@ do_debug(cmd)
         * This makes sure we get input from the user here and don't interfere
         * with the commands being executed.  Reset "ex_normal_busy" to avoid
         * the side effects of using ":normal". Save the stuff buffer and make
-        * it empty. */
+        * it empty. Set ignore_script to avoid reading from script input. */
 # ifdef FEAT_EX_EXTRA
        save_ex_normal_busy = ex_normal_busy;
        ex_normal_busy = 0;
 # endif
        if (!debug_greedy)
+       {
            save_typeahead(&typeaheadbuf);
+           typeahead_saved = TRUE;
+           save_ignore_script = ignore_script;
+           ignore_script = TRUE;
+       }
 
        cmdline = getcmdline_prompt('>', NULL, 0, EXPAND_NOTHING, NULL);
 
-       if (!debug_greedy)
+       if (typeahead_saved)
+       {
            restore_typeahead(&typeaheadbuf);
+           ignore_script = save_ignore_script;
+       }
 # ifdef FEAT_EX_EXTRA
        ex_normal_busy = save_ex_normal_busy;
 # endif
index 0e78a7bd87a1f0f7e1dd8bfdfc7257f780b780d3..d1c70c9db14273c848340242faf9f250d739ac4c 100644 (file)
@@ -1279,8 +1279,14 @@ alloc_typebuf()
     void
 free_typebuf()
 {
-    vim_free(typebuf.tb_buf);
-    vim_free(typebuf.tb_noremap);
+    if (typebuf.tb_buf == typebuf_init)
+       EMSG2(_(e_intern2), "Free typebuf 1");
+    else
+       vim_free(typebuf.tb_buf);
+    if (typebuf.tb_buf == noremapbuf_init)
+       EMSG2(_(e_intern2), "Free typebuf 2");
+    else
+       vim_free(typebuf.tb_noremap);
 }
 
 /*
@@ -1359,6 +1365,11 @@ openscript(name, directly)
        EMSG(_(e_nesting));
        return;
     }
+#ifdef FEAT_EVAL
+    if (ignore_script)
+       /* Not reading from script, also don't open one.  Warning message? */
+       return;
+#endif
 
     if (scriptin[curscript] != NULL)   /* already reading script */
        ++curscript;
@@ -2346,7 +2357,7 @@ vgetorpeek(advance)
                                                   current_menu->silent[idx]);
                                }
                            }
-#endif /* FEAT_GUI */
+#endif /* FEAT_GUI && FEAT_MENU */
                            continue;   /* try mapping again */
                        }
 
@@ -2862,11 +2873,15 @@ inchar(buf, maxlen, wait_time, tb_change_cnt)
     undo_off = FALSE;              /* restart undo now */
 
     /*
-     * first try script file
-     * If interrupted: Stop reading script files.
+     * Get a character from a script file if there is one.
+     * If interrupted: Stop reading script files, close them all.
      */
     script_char = -1;
-    while (scriptin[curscript] != NULL && script_char < 0)
+    while (scriptin[curscript] != NULL && script_char < 0
+#ifdef FEAT_EVAL
+           && !ignore_script
+#endif
+           )
     {
        if (got_int || (script_char = getc(scriptin[curscript])) < 0)
        {
index 7fec4e6435d0d4ae64300c895762bb20d3a0aa6a..a77f14b07d748c703191d5d1c93be12f50fc8321 100644 (file)
@@ -954,6 +954,9 @@ EXTERN typebuf_T typebuf            /* typeahead buffer */
 EXTERN int     ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */
 EXTERN int     ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */
 #endif
+#ifdef FEAT_EVAL
+EXTERN int     ignore_script INIT(= FALSE);  /* ignore script input */
+#endif
 EXTERN int     stop_insert_mode;       /* for ":stopinsert" and 'insertmode' */
 
 EXTERN int     KeyTyped;               /* TRUE if user typed current char */
index 531c126720a81d921e928f043fd67a87f512ec2c..e20349dc97307f8e75ff8636ce8216507eef998b 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    177,
 /**/
     176,
 /**/