-*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
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|.
" 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
}
#if defined(FEAT_EVAL) || defined(PROTO)
+
/*
* ":scriptnames"
*/
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)
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
* 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 */
}
}
+#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
*/
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.
/* 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));
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));
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));
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 : */
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));
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));
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));
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;
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()
{
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.
{
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;
#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 "