]> granicus.if.org Git - vim/commitdiff
updated for version 7.0092
authorBram Moolenaar <Bram@vim.org>
Fri, 24 Jun 2005 23:07:47 +0000 (23:07 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 24 Jun 2005 23:07:47 +0000 (23:07 +0000)
16 files changed:
runtime/doc/options.txt
runtime/indent/aap.vim
src/ex_cmds2.c
src/ex_getln.c
src/misc2.c
src/ops.c
src/proto/eval.pro
src/proto/fileio.pro
src/proto/hashtable.pro
src/proto/os_unix.pro
src/proto/spell.pro
src/proto/window.pro
src/screen.c
src/syntax.c
src/undo.c
src/version.h

index 7b37b73a66105c605ea4957e4433202360f40fdc..915f3ebe38132751959c06803db8c3bcc9c6da7c 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 7.0aa.  Last change: 2005 Jun 23
+*options.txt*  For Vim version 7.0aa.  Last change: 2005 Jun 24
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -5673,6 +5673,9 @@ A jump table for the options with a short description can be found at |Q_op|.
        region by listing them: "en_us,en_ca" supports both US and Canadian
        English, but not words specific for Australia, New Zealand or Great
        Britain.
+       As a special case the name of a .spl file can be given as-is.  This is
+       mainly for testing purposes.  You must make sure the correct encoding
+       is used, Vim doesn't check it.
        When 'encoding' is set the word lists are reloaded.  Thus it's a good
        idea to set 'spelllang' after setting 'encoding'.
        How the related spell files are found is explained here: |spell-load|.
index 78ac0336dd292b4976f5b5a479fd63a429d51d58..35828b4c1a5be677df091c5b5680551b0075b39f 100644 (file)
@@ -1,7 +1,12 @@
 " Vim indent file
 " Language:    Aap recipe
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2003 Sep 08
+" Last Change: 2005 Jun 24
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
 
 " Works mostly like Python.
 runtime! indent/python.vim
index 3c591d0267d78fd43dd3d34aea50dfe731a2ab53..b86e4812eab41974a8d97e915d881b57a22536dc 100644 (file)
@@ -3020,6 +3020,7 @@ theend:
 }
 
 #if defined(FEAT_EVAL) || defined(PROTO)
+
 /*
  * ":scriptnames"
  */
@@ -3068,6 +3069,18 @@ get_scriptname(id)
     return SCRIPT_ITEM(id).sn_name;
 }
 
+# if defined(EXITFREE) || defined(PROTO)
+    void
+free_scriptnames()
+{
+    int                        i;
+
+    for (i = script_items.ga_len; i > 0; --i)
+       vim_free(SCRIPT_ITEM(i).sn_name);
+    ga_clear(&script_items);
+}
+# endif
+
 #endif
 
 #if defined(USE_CR) || defined(PROTO)
index 51b2f251c9f36d8d94d807971f7d378831ba9a3f..86da1aa88a26e3abdf290816aeab00b27c7f841a 100644 (file)
@@ -55,7 +55,6 @@ static int    hisnum[HIST_COUNT] = {0, 0, 0, 0, 0};
 static int     hislen = 0;             /* actual length of history tables */
 
 static int     hist_char2type __ARGS((int c));
-static void    init_history __ARGS((void));
 
 static int     in_history __ARGS((int, char_u *, int));
 # ifdef FEAT_EVAL
@@ -4423,7 +4422,7 @@ static char *(history_names[]) =
  * init_history() - Initialize the command line history.
  * Also used to re-allocate the history when the size changes.
  */
-    static void
+    void
 init_history()
 {
     int                newlen;     /* new length of history table */
index ace3a907adefe5fe4bde0cd82070949eeeed1ccd..4fdbc2798a4b4e1485fcef4c5332180589f53abd 100644 (file)
@@ -921,6 +921,103 @@ do_outofmem_msg(size)
     }
 }
 
+#if defined(EXITFREE) || defined(PROTO)
+/*
+ * Free everything that we allocated.
+ * Can be used to detect memory leaks, e.g., with ccmalloc.
+ * Doesn't do nearly all that is required...
+ */
+    void
+free_all_mem()
+{
+    buf_T      *buf, *nextbuf;
+
+    ++autocmd_block;       /* don't want to trigger autocommands here */
+
+# if defined(FEAT_SYN_HL)
+    /* Free all spell info. */
+    spell_free_all();
+# endif
+
+#if defined(FEAT_USR_CMDS)
+    /* Clear user commands (before deleting buffers). */
+    ex_comclear(NULL);
+#endif
+
+# ifdef FEAT_MENU
+    /* Clear menus. */
+    do_cmdline_cmd((char_u *)"aunmenu *");
+# endif
+
+    /* Clear mappings and abbreviations. */
+    do_cmdline_cmd((char_u *)"mapclear");
+    do_cmdline_cmd((char_u *)"mapclear!");
+    do_cmdline_cmd((char_u *)"abclear");
+
+    /* Obviously named calls. */
+# if defined(FEAT_EVAL)
+    free_scriptnames();
+    free_all_functions();
+# endif
+# if defined(FEAT_AUTOCMD)
+    free_all_autocmds();
+# endif
+    clear_termcodes();
+
+    /* Clear cmdline history. */
+    p_hi = 0;
+    init_history();
+
+    /* Free all buffers. */
+    for (buf = firstbuf; buf != NULL; )
+    {
+       nextbuf = buf->b_next;
+       close_buffer(NULL, buf, DOBUF_WIPE);
+       if (buf_valid(buf))
+           buf = nextbuf;      /* didn't work, try next one */
+       else
+           buf = firstbuf;
+    }
+
+#if defined(FEAT_WINDOWS)
+    /* Destroy all windows. */
+    win_free_all();
+#endif
+
+    /* Clear registers. */
+    clear_registers();
+    ResetRedobuff();
+    ResetRedobuff();
+
+    /* highlight info */
+    free_highlight();
+
+# ifdef UNIX
+    /* Machine-specific free. */
+    mch_free_mem();
+# endif
+
+    /* message history */
+    for (;;)
+       if (delete_first_msg() == FAIL)
+           break;
+
+# ifdef FEAT_EVAL
+    eval_clear();
+# endif
+
+    /* screenlines (can't display anything now!) */
+    free_screenlines();
+
+#if defined(USE_XSMP)
+    xsmp_close();
+#endif
+
+    vim_free(IObuff);
+    vim_free(NameBuff);
+}
+#endif
+
 /*
  * copy a string into newly allocated memory
  */
index 45023130519c5bb609f9d436551349f8fe96ffbb..bbeedbf4a1060bbabfabcd27fdffcba4f755a4b8 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -2602,6 +2602,21 @@ init_yank()
        y_regs[i].y_array = NULL;
 }
 
+#if defined(EXITFREE) || defined(PROTO)
+    void
+clear_registers()
+{
+    int                i;
+
+    for (i = 0; i < NUM_REGISTERS; ++i)
+    {
+       y_current = &y_regs[i];
+       if (y_current->y_array != NULL)
+           free_yank_all();
+    }
+}
+#endif
+
 /*
  * Free "n" lines from the current yank register.
  * Called for normal freeing and in case of error.
index 13bd82af80a4539b7ce643b219693a0b64854efc..539baa6b7987f8ec202372c9c6a0abf082a1eb63 100644 (file)
@@ -1,5 +1,6 @@
 /* eval.c */
 void eval_init __ARGS((void));
+void eval_clear __ARGS((void));
 char_u *func_name __ARGS((void *cookie));
 linenr_T *func_breakpoint __ARGS((void *cookie));
 int *func_dbg_tick __ARGS((void *cookie));
@@ -60,6 +61,7 @@ void ex_echo __ARGS((exarg_T *eap));
 void ex_echohl __ARGS((exarg_T *eap));
 void ex_execute __ARGS((exarg_T *eap));
 void ex_function __ARGS((exarg_T *eap));
+void free_all_functions __ARGS((void));
 void func_dump_profile __ARGS((FILE *fd));
 char_u *get_user_func_name __ARGS((expand_T *xp, int idx));
 void ex_delfunction __ARGS((exarg_T *eap));
index 7d59f557b6de7a7ee3fbd43a75fe268e92124b3b..8b051130cfbc54bdfdef23e2c47f180b48c1f93b 100644 (file)
@@ -23,6 +23,7 @@ char_u *vim_tempname __ARGS((int extra_char));
 void forward_slash __ARGS((char_u *fname));
 void aubuflocal_remove __ARGS((buf_T *buf));
 void do_augroup __ARGS((char_u *arg, int del_group));
+void free_all_autocmds __ARGS((void));
 int check_ei __ARGS((void));
 char_u *au_event_disable __ARGS((char *what));
 void au_event_restore __ARGS((char_u *old_ei));
index e82f1756a978588bbb68e13a6d3fa99dd461b03e..aebb458d660f5b35edfdc8513fd797965bbca875 100644 (file)
@@ -8,7 +8,6 @@ int hash_add __ARGS((hashtab_T *ht, char_u *key));
 int hash_add_item __ARGS((hashtab_T *ht, hashitem_T *hi, char_u *key, hash_T hash));
 void hash_remove __ARGS((hashtab_T *ht, hashitem_T *hi));
 void hash_lock __ARGS((hashtab_T *ht));
-void hash_lock_size __ARGS((hashtab_T *ht, int size));
 void hash_unlock __ARGS((hashtab_T *ht));
 hash_T hash_hash __ARGS((char_u *key));
 /* vim: set ft=c : */
index 3554040b81a5dc42ca11b0ad75bf121837de41c8..d2f5e174efcee182b951c25419a11703d6d5bc20 100644 (file)
@@ -41,6 +41,7 @@ int mch_isdir __ARGS((char_u *name));
 int mch_can_exe __ARGS((char_u *name));
 int mch_nodetype __ARGS((char_u *name));
 void mch_early_init __ARGS((void));
+void mch_free_mem __ARGS((void));
 void mch_exit __ARGS((int r));
 void mch_settmode __ARGS((int tmode));
 void get_stty __ARGS((void));
index 900f3bf47f1e8586bae70024bbc0810438c9e62d..37830ca6e0c4afebcb70c386370ba5be0b633e92 100644 (file)
@@ -3,6 +3,7 @@ int spell_check __ARGS((win_T *wp, char_u *ptr, int *attrp));
 int spell_move_to __ARGS((int dir, int allwords, int curline));
 void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
 char_u *did_set_spelllang __ARGS((buf_T *buf));
+void spell_free_all __ARGS((void));
 void spell_reload __ARGS((void));
 void put_bytes __ARGS((FILE *fd, long_u nr, int len));
 void ex_mkspell __ARGS((exarg_T *eap));
index f01eee00c52d614df1f734a8895cbf0330ee2953..fd3d62f3774ac2f4cfae2438273d5a5832c63089 100644 (file)
@@ -8,6 +8,7 @@ void win_move_after __ARGS((win_T *win1, win_T *win2));
 void win_equal __ARGS((win_T *next_curwin, int current, int dir));
 void close_windows __ARGS((buf_T *buf));
 void win_close __ARGS((win_T *win, int free_buf));
+void win_free_all __ARGS((void));
 void close_others __ARGS((int message, int forceit));
 void win_init __ARGS((win_T *wp));
 void win_alloc_first __ARGS((void));
index 595058a703411923034cf7c606dc7652f9b97016..dfeca60552c8cb51af68303dba6f5bf9a965122a 100644 (file)
@@ -6798,16 +6798,8 @@ screenalloc(clear)
        current_ScreenLine = new_ScreenLines + Rows * Columns;
     }
 
-    vim_free(ScreenLines);
-#ifdef FEAT_MBYTE
-    vim_free(ScreenLinesUC);
-    vim_free(ScreenLinesC1);
-    vim_free(ScreenLinesC2);
-    vim_free(ScreenLines2);
-#endif
-    vim_free(ScreenAttrs);
-    vim_free(LineOffset);
-    vim_free(LineWraps);
+    free_screenlines();
+
     ScreenLines = new_ScreenLines;
 #ifdef FEAT_MBYTE
     ScreenLinesUC = new_ScreenLinesUC;
@@ -6854,6 +6846,21 @@ screenalloc(clear)
     entered = FALSE;
 }
 
+    void
+free_screenlines()
+{
+    vim_free(ScreenLines);
+#ifdef FEAT_MBYTE
+    vim_free(ScreenLinesUC);
+    vim_free(ScreenLinesC1);
+    vim_free(ScreenLinesC2);
+    vim_free(ScreenLines2);
+#endif
+    vim_free(ScreenAttrs);
+    vim_free(LineOffset);
+    vim_free(LineWraps);
+}
+
     void
 screenclear()
 {
index 4fdbbbf6fbd6a71c53316b6f8a89aed13ab7f9cc..6092a1c97527d8438a32a3c919b3217c3f1653af 100644 (file)
@@ -7067,6 +7067,18 @@ do_highlight(line, forceit, init)
     need_highlight_changed = TRUE;
 }
 
+#if defined(EXITFREE) || defined(PROTO)
+    void
+free_highlight()
+{
+    int            i;
+
+    for (i = 0; i < highlight_ga.ga_len; ++i)
+       highlight_clear(i);
+    ga_clear(&highlight_ga);
+}
+#endif
+
 /*
  * Reset the cterm colors to what they were before Vim was started, if
  * possible.  Otherwise reset them to zero.
index 0ad3ae1a1c31db5eda55c568d9a0218e6bfbce31..2bb54561773fd454d21e0a673b6a4f251fb1ff7a 100644 (file)
@@ -949,7 +949,7 @@ u_saveline(lnum)
 {
     if (lnum == curbuf->b_u_line_lnum)     /* line is already saved */
        return;
-    if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) /* should never happen */
+    if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) /* should never happen */
        return;
     u_clearline();
     curbuf->b_u_line_lnum = lnum;
index 01c298e7e136b3c077ccc48722589124afab81a9..4de29d0c1c8de2efa7d2555b4f00af60e3d59b7b 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 23)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 23, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 24)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 24, compiled "