diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 3 | ||||
-rw-r--r-- | src/buffer.c | 6 | ||||
-rw-r--r-- | src/edit.c | 9 | ||||
-rw-r--r-- | src/eval.c | 21 | ||||
-rw-r--r-- | src/ex_cmds.c | 4 | ||||
-rw-r--r-- | src/ex_cmds.h | 6 | ||||
-rw-r--r-- | src/ex_docmd.c | 7 | ||||
-rw-r--r-- | src/ex_getln.c | 25 | ||||
-rw-r--r-- | src/feature.h | 9 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/globals.h | 7 | ||||
-rw-r--r-- | src/gui_gtk_x11.c | 1 | ||||
-rw-r--r-- | src/hashtable.c | 25 | ||||
-rw-r--r-- | src/memline.c | 146 | ||||
-rw-r--r-- | src/message.c | 2 | ||||
-rw-r--r-- | src/misc1.c | 4 | ||||
-rw-r--r-- | src/misc2.c | 6 | ||||
-rw-r--r-- | src/po/it.po | 150 | ||||
-rw-r--r-- | src/proto/eval.pro | 1 | ||||
-rw-r--r-- | src/proto/hashtable.pro | 1 | ||||
-rw-r--r-- | src/proto/memline.pro | 61 | ||||
-rw-r--r-- | src/proto/spell.pro | 4 | ||||
-rw-r--r-- | src/quickfix.c | 40 | ||||
-rw-r--r-- | src/screen.c | 11 | ||||
-rw-r--r-- | src/spell.c | 4874 | ||||
-rw-r--r-- | src/structs.h | 22 | ||||
-rw-r--r-- | src/testdir/test58.ok | 14 | ||||
-rw-r--r-- | src/testdir/test59.ok | 14 | ||||
-rw-r--r-- | src/testdir/test60.in | 262 | ||||
-rw-r--r-- | src/testdir/test60.ok | 76 | ||||
-rw-r--r-- | src/testdir/test60.vim | 97 | ||||
-rw-r--r-- | src/version.h | 4 |
32 files changed, 4276 insertions, 1638 deletions
diff --git a/src/Makefile b/src/Makefile index 8dd1be3e6e..810dd7b78b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -532,9 +532,12 @@ LINT_OPTIONS = -beprxzF # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof. # Might not work with GUI or Perl. +# For unknown reasons adding "-lc" fixes a linking problem with GCC. That's +# probably a bug in the "-pg" implementation. # Need to recompile everything after changing this: "make clean" "make". #PROFILE_CFLAGS = -pg -g #PROFILE_LIBS = -pg +#PROFILE_LIBS = -pg -lc # MEMORY LEAK DETECTION # Requires installing the ccmalloc library. diff --git a/src/buffer.c b/src/buffer.c index f252489c29..1190117915 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -82,7 +82,7 @@ open_buffer(read_stdin, eap) && (curbuf->b_flags & BF_NEVERLOADED)) curbuf->b_p_ro = TRUE; - if (ml_open() == FAIL) + if (ml_open(curbuf) == FAIL) { /* * There MUST be a memfile, otherwise we can't do anything @@ -1505,6 +1505,8 @@ buflist_new(ffname, sfname, lnum, flags) * buffer. Otherwise: Need to allocate a new buffer structure. * * This is the ONLY place where a new buffer structure is allocated! + * (A spell file buffer is allocated in spell.c, but that's not a normal + * buffer.) */ buf = NULL; if ((flags & BLN_CURBUF) @@ -5191,7 +5193,7 @@ buf_contents_changed(buf) curwin->w_buffer = newbuf; #endif - if (ml_open() == OK + if (ml_open(curbuf) == OK && readfile(buf->b_ffname, buf->b_fname, (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, &ea, READ_NEW | READ_DUMMY) == OK) diff --git a/src/edit.c b/src/edit.c index 23dd57eb9d..c037d1f961 100644 --- a/src/edit.c +++ b/src/edit.c @@ -987,6 +987,15 @@ doESCkey: case K_IGNORE: /* Something mapped to nothing */ break; +#ifdef FEAT_GUI_W32 + /* On Win32 ignore <M-F4>, we get it when closing the window was + * cancelled. */ + case K_F4: + if (mod_mask != MOD_MASK_ALT) + goto normalchar; + break; +#endif + #ifdef FEAT_GUI case K_VER_SCROLLBAR: ins_scroll(); diff --git a/src/eval.c b/src/eval.c index eef865a4bd..4823593317 100644 --- a/src/eval.c +++ b/src/eval.c @@ -654,7 +654,6 @@ static int get_var_tv __ARGS((char_u *name, int len, typval_T *rettv, int verbos static int handle_subscript __ARGS((char_u **arg, typval_T *rettv, int evaluate, int verbose)); static typval_T *alloc_tv __ARGS((void)); static typval_T *alloc_string_tv __ARGS((char_u *string)); -static void free_tv __ARGS((typval_T *varp)); static void init_tv __ARGS((typval_T *varp)); static long get_tv_number __ARGS((typval_T *varp)); static linenr_T get_tv_lnum __ARGS((typval_T *argvars)); @@ -1323,7 +1322,9 @@ get_spellword(list, pp) #endif /* - * Top level evaluation function, + * Top level evaluation function. + * Returns an allocated typval_T with the result. + * Returns NULL when there is an error. */ typval_T * eval_expr(arg, nextcmd) @@ -1333,13 +1334,10 @@ eval_expr(arg, nextcmd) typval_T *tv; tv = (typval_T *)alloc(sizeof(typval_T)); - if (!tv) - return NULL; - - if (eval0(arg, tv, nextcmd, TRUE) == FAIL) + if (tv != NULL && eval0(arg, tv, nextcmd, TRUE) == FAIL) { vim_free(tv); - return NULL; + tv = NULL; } return tv; @@ -13930,7 +13928,7 @@ f_spellbadword(argvars, rettv) /* Check the argument for spelling. */ while (*str != NUL) { - len = spell_check(curwin, str, &attr, &capcol); + len = spell_check(curwin, str, &attr, &capcol, FALSE); if (attr != HLF_COUNT) { word = str; @@ -13996,7 +13994,7 @@ f_spellsuggest(argvars, rettv) else maxcount = 25; - spell_suggest_list(&ga, str, maxcount, need_capital); + spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); for (i = 0; i < ga.ga_len; ++i) { @@ -15904,7 +15902,7 @@ alloc_string_tv(s) /* * Free the memory for a variable type-value. */ - static void + void free_tv(varp) typval_T *varp; { @@ -16910,7 +16908,10 @@ ex_execute(eap) if (ret != FAIL && ga.ga_data != NULL) { if (eap->cmdidx == CMD_echomsg) + { MSG_ATTR(ga.ga_data, echo_attr); + out_flush(); + } else if (eap->cmdidx == CMD_echoerr) { /* We don't want to abort following commands, restore did_emsg. */ diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 006733c4d8..c4fd0c4bd0 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -111,9 +111,9 @@ do_ascii(eap) IObuff[len++] = ' '; IObuff[len++] = '<'; if (utf_iscomposing(c) -#ifdef USE_GUI +# ifdef USE_GUI && !gui.in_use -#endif +# endif ) IObuff[len++] = ' '; /* draw composing char on top of a space */ len += (*mb_char2bytes)(c, IObuff + len); diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 4c4ab6ff07..a15ed464d8 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -187,6 +187,8 @@ EX(CMD_cabbrev, "cabbrev", ex_abbreviate, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_cabclear, "cabclear", ex_abclear, EXTRA|TRLBAR|CMDWIN), +EX(CMD_caddexpr, "caddexpr", ex_cexpr, + NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG), EX(CMD_caddfile, "caddfile", ex_cfile, TRLBAR|FILE1), EX(CMD_call, "call", ex_call, @@ -394,7 +396,7 @@ EX(CMD_for, "for", ex_while, EX(CMD_function, "function", ex_function, EXTRA|BANG|CMDWIN), EX(CMD_global, "global", ex_global, - RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|CMDWIN), + RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN), EX(CMD_goto, "goto", ex_goto, RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN), EX(CMD_grep, "grep", ex_make, @@ -768,7 +770,7 @@ EX(CMD_spellgood, "spellgood", ex_spell, EX(CMD_spellwrong, "spellwrong", ex_spell, BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR), EX(CMD_spelldump, "spelldump", ex_spelldump, - TRLBAR), + BANG|TRLBAR), EX(CMD_spellrepall, "spellrepall", ex_spellrepall, TRLBAR), EX(CMD_sprevious, "sprevious", ex_previous, diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 1eb2bb9a55..e15c6c5d7b 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8234,8 +8234,11 @@ ex_mkrc(eap) failed = TRUE; if (put_line(fd, "doautoall SessionLoadPost") == FAIL) failed = TRUE; - if (put_line(fd, "unlet SessionLoad") == FAIL) - failed = TRUE; + if (eap->cmdidx == CMD_mksession) + { + if (put_line(fd, "unlet SessionLoad") == FAIL) + failed = TRUE; + } } #endif if (put_line(fd, "\" vim: set ft=vim :") == FAIL) diff --git a/src/ex_getln.c b/src/ex_getln.c index 335f2a411c..95109534aa 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -645,8 +645,8 @@ getcmdline(firstc, count, indent) /* * Replace the command line with the result of an expression. - * Need to save the current command line, to be able to enter - * a new one... + * Need to save and restore the current command line, to be + * able to enter a new one... */ if (ccline.cmdpos == ccline.cmdlen) new_cmdpos = 99999; /* keep it at the end */ @@ -658,8 +658,17 @@ getcmdline(firstc, count, indent) restore_cmdline(&save_ccline); if (c == '=') { + /* Need to save and restore ccline. And go into the + * sandbox to avoid nasty things like going to another + * buffer when evaluating an expression. */ save_cmdline(&save_ccline); +#ifdef HAVE_SANDBOX + ++sandbox; +#endif p = get_expr_line(); +#ifdef HAVE_SANDBOX + --sandbox; +#endif restore_cmdline(&save_ccline); if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) @@ -1192,6 +1201,18 @@ getcmdline(firstc, count, indent) case K_IGNORE: goto cmdline_not_changed; /* Ignore mouse */ +#ifdef FEAT_GUI_W32 + /* On Win32 ignore <M-F4>, we get it when closing the window was + * cancelled. */ + case K_F4: + if (mod_mask == MOD_MASK_ALT) + { + redrawcmd(); /* somehow the cmdline is cleared */ + goto cmdline_not_changed; + } + break; +#endif + #ifdef FEAT_MOUSE case K_MIDDLEDRAG: case K_MIDDLERELEASE: diff --git a/src/feature.h b/src/feature.h index 69a784e442..efe7915675 100644 --- a/src/feature.h +++ b/src/feature.h @@ -127,6 +127,15 @@ #endif /* + * Message history is fixed at 100 message, 20 for the tiny version. + */ +#ifdef FEAT_SMALL +# define MAX_MSG_HIST_LEN 100 +#else +# define MAX_MSG_HIST_LEN 20 +#endif + +/* * +jumplist Jumplist, CTRL-O and CTRL-I commands. */ #ifdef FEAT_SMALL diff --git a/src/fileio.c b/src/fileio.c index e05fb54db8..c5c9262998 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6405,7 +6405,7 @@ buf_reload(buf) /* Open the memline. */ curbuf = savebuf; curwin->w_buffer = savebuf; - saved = ml_open(); + saved = ml_open(curbuf); curbuf = buf; curwin->w_buffer = buf; } diff --git a/src/globals.h b/src/globals.h index 8c21105698..c22466c069 100644 --- a/src/globals.h +++ b/src/globals.h @@ -528,7 +528,12 @@ EXTERN int starting INIT(= NO_SCREEN); /* first NO_SCREEN, then NO_BUFFERS and then * set to 0 when starting up finished */ EXTERN int exiting INIT(= FALSE); - /* TRUE when abandoning Vim */ + /* TRUE when planning to exit Vim. Might + * still keep on running if there is a changed + * buffer. */ +EXTERN int really_exiting INIT(= FALSE); + /* TRUE when we are sure to exit, e.g., after + * a deadly signal */ EXTERN int full_screen INIT(= FALSE); /* TRUE when doing full-screen output * otherwise only writing some messages */ diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 1502e0c1c0..84c5fe4064 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -2328,6 +2328,7 @@ sm_client_die(GnomeClient *client, gpointer data) vim_strncpy(IObuff, _("Vim: Received \"die\" request from session manager\n"), IOSIZE - 1); + deadly_exit = TRUE; preserve_exit(); } diff --git a/src/hashtable.c b/src/hashtable.c index 904be4704c..066f0f3cbb 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -86,6 +86,31 @@ hash_clear(ht) } /* + * Free the array of a hash table and all the keys it contains. The keys must + * have been allocated. "off" is the offset from the start of the allocate + * memory to the location of the key (it's always positive). + */ + void +hash_clear_all(ht, off) + hashtab_T *ht; + int off; +{ + int todo; + hashitem_T *hi; + + todo = ht->ht_used; + for (hi = ht->ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { + vim_free(hi->hi_key - off); + --todo; + } + } + hash_clear(ht); +} + +/* * Find "key" in hashtable "ht". "key" must not be NULL. * Always returns a pointer to a hashitem. If the item was not found then * HASHITEM_EMPTY() is TRUE. The pointer is then the place where the key diff --git a/src/memline.c b/src/memline.c index 3eba98d598..9abf155234 100644 --- a/src/memline.c +++ b/src/memline.c @@ -13,10 +13,11 @@ /* * memline.c: Contains the functions for appending, deleting and changing the - * text lines. The memfile functions are used to store the information in blocks - * of memory, backed up by a file. The structure of the information is a tree. - * The root of the tree is a pointer block. The leaves of the tree are data - * blocks. In between may be several layers of pointer blocks, forming branches. + * text lines. The memfile functions are used to store the information in + * blocks of memory, backed up by a file. The structure of the information is + * a tree. The root of the tree is a pointer block. The leaves of the tree + * are data blocks. In between may be several layers of pointer blocks, + * forming branches. * * Three types of blocks are used: * - Block nr 0 contains information for recovery @@ -169,7 +170,7 @@ struct block0 }; /* - * Note: b0_fname and b0_flags are put at the end of the file name. For very + * Note: b0_dirty and b0_flags are put at the end of the file name. For very * long file names in older versions of Vim they are invalid. * The 'fileencoding' comes before b0_flags, with a NUL in front. But only * when there is room, for very long file names it's omitted. @@ -245,12 +246,13 @@ static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype) #endif /* - * open a new memline for 'curbuf' + * Open a new memline for "buf". * - * return FAIL for failure, OK otherwise + * Return FAIL for failure, OK otherwise. */ int -ml_open() +ml_open(buf) + buf_T *buf; { memfile_T *mfp; bhdr_T *hp = NULL; @@ -258,36 +260,36 @@ ml_open() PTR_BL *pp; DATA_BL *dp; -/* - * init fields in memline struct - */ - curbuf->b_ml.ml_stack_size = 0; /* no stack yet */ - curbuf->b_ml.ml_stack = NULL; /* no stack yet */ - curbuf->b_ml.ml_stack_top = 0; /* nothing in the stack */ - curbuf->b_ml.ml_locked = NULL; /* no cached block */ - curbuf->b_ml.ml_line_lnum = 0; /* no cached line */ + /* + * init fields in memline struct + */ + buf->b_ml.ml_stack_size = 0; /* no stack yet */ + buf->b_ml.ml_stack = NULL; /* no stack yet */ + buf->b_ml.ml_stack_top = 0; /* nothing in the stack */ + buf->b_ml.ml_locked = NULL; /* no cached block */ + buf->b_ml.ml_line_lnum = 0; /* no cached line */ #ifdef FEAT_BYTEOFF - curbuf->b_ml.ml_chunksize = NULL; + buf->b_ml.ml_chunksize = NULL; #endif -/* - * When 'updatecount' is non-zero, flag that a swap file may be opened later. - */ - if (p_uc && curbuf->b_p_swf) - curbuf->b_may_swap = TRUE; + /* + * When 'updatecount' is non-zero swap file may be opened later. + */ + if (p_uc && buf->b_p_swf) + buf->b_may_swap = TRUE; else - curbuf->b_may_swap = FALSE; + buf->b_may_swap = FALSE; -/* - * Open the memfile. No swap file is created yet. - */ + /* + * Open the memfile. No swap file is created yet. + */ mfp = mf_open(NULL, 0); if (mfp == NULL) goto error; - curbuf->b_ml.ml_mfp = mfp; - curbuf->b_ml.ml_flags = ML_EMPTY; - curbuf->b_ml.ml_line_count = 1; + buf->b_ml.ml_mfp = mfp; + buf->b_ml.ml_flags = ML_EMPTY; + buf->b_ml.ml_line_count = 1; #ifdef FEAT_LINEBREAK curwin->w_nrwidth_line_count = 0; #endif @@ -296,7 +298,7 @@ ml_open() /* for 16 bit MS-DOS create a swapfile now, because we run out of * memory very quickly */ if (p_uc != 0) - ml_open_file(curbuf); + ml_open_file(buf); #endif /* @@ -313,36 +315,40 @@ ml_open() b0p->b0_id[0] = BLOCK0_ID0; b0p->b0_id[1] = BLOCK0_ID1; - b0p->b0_dirty = curbuf->b_changed ? B0_DIRTY : 0; - b0p->b0_flags = get_fileformat(curbuf) + 1; b0p->b0_magic_long = (long)B0_MAGIC_LONG; b0p->b0_magic_int = (int)B0_MAGIC_INT; b0p->b0_magic_short = (short)B0_MAGIC_SHORT; b0p->b0_magic_char = B0_MAGIC_CHAR; - STRNCPY(b0p->b0_version, "VIM ", 4); STRNCPY(b0p->b0_version + 4, Version, 6); - set_b0_fname(b0p, curbuf); long_to_char((long)mfp->mf_page_size, b0p->b0_page_size); - (void)get_user_name(b0p->b0_uname, B0_UNAME_SIZE); - b0p->b0_uname[B0_UNAME_SIZE - 1] = NUL; - mch_get_host_name(b0p->b0_hname, B0_HNAME_SIZE); - b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL; - long_to_char(mch_get_pid(), b0p->b0_pid); + + if (!B_SPELL(buf)) + { + b0p->b0_dirty = buf->b_changed ? B0_DIRTY : 0; + b0p->b0_flags = get_fileformat(buf) + 1; + set_b0_fname(b0p, buf); + (void)get_user_name(b0p->b0_uname, B0_UNAME_SIZE); + b0p->b0_uname[B0_UNAME_SIZE - 1] = NUL; + mch_get_host_name(b0p->b0_hname, B0_HNAME_SIZE); + b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL; + long_to_char(mch_get_pid(), b0p->b0_pid); + } /* * Always sync block number 0 to disk, so we can check the file name in - * the swap file in findswapname(). Don't do this for help files though. + * the swap file in findswapname(). Don't do this for help files though + * and spell buffer though. * Only works when there's a swapfile, otherwise it's done when the file * is created. */ mf_put(mfp, hp, TRUE, FALSE); - if (!curbuf->b_help) + if (!buf->b_help && !B_SPELL(buf)) (void)mf_sync(mfp, 0); -/* - * fill in root pointer block and write page 1 - */ + /* + * Fill in root pointer block and write page 1. + */ if ((hp = ml_new_ptr(mfp)) == NULL) goto error; if (hp->bh_bnum != 1) @@ -358,9 +364,9 @@ ml_open() pp->pb_pointer[0].pe_line_count = 1; /* line count after insertion */ mf_put(mfp, hp, TRUE, FALSE); -/* - * allocate first data block and create an empty line 1. - */ + /* + * Allocate first data block and create an empty line 1. + */ if ((hp = ml_new_data(mfp, FALSE, 1)) == NULL) goto error; if (hp->bh_bnum != 2) @@ -384,7 +390,7 @@ error: mf_put(mfp, hp, FALSE, FALSE); mf_close(mfp, TRUE); /* will also free(mfp->mf_fname) */ } - curbuf->b_ml.ml_mfp = NULL; + buf->b_ml.ml_mfp = NULL; return FAIL; } @@ -518,6 +524,18 @@ ml_open_file(buf) if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf) return; /* nothing to do */ +#ifdef FEAT_SYN_HL + /* For a spell buffer use a temp file name. */ + if (buf->b_spell) + { + fname = vim_tempname('s'); + if (fname != NULL) + (void)mf_open_file(mfp, fname); /* consumes fname! */ + buf->b_may_swap = FALSE; + return; + } +#endif + /* * Try all directories in 'directory' option. */ @@ -886,7 +904,7 @@ ml_recover() goto theend; /* out of memory */ /* When called from main() still need to initialize storage structure */ - if (called_from_main && ml_open() == FAIL) + if (called_from_main && ml_open(curbuf) == FAIL) getout(1); /* @@ -2100,6 +2118,28 @@ ml_append(lnum, line, len, newfile) return ml_append_int(curbuf, lnum, line, len, newfile, FALSE); } +#if defined(FEAT_SYN_HL) || defined(PROTO) +/* + * Like ml_append() but for an arbitrary buffer. The buffer must already have + * a memline. + */ + int +ml_append_buf(buf, lnum, line, len, newfile) + buf_T *buf; + linenr_T lnum; /* append after this line (can be 0) */ + char_u *line; /* text of the new line */ + colnr_T len; /* length of new line, including NUL, or 0 */ + int newfile; /* flag, see above */ +{ + if (buf->b_ml.ml_mfp == NULL) + return FAIL; + + if (buf->b_ml.ml_line_lnum != 0) + ml_flush_line(buf); + return ml_append_int(buf, lnum, line, len, newfile, FALSE); +} +#endif + static int ml_append_int(buf, lnum, line, len, newfile, mark) buf_T *buf; @@ -2599,7 +2639,7 @@ ml_append_int(buf, lnum, line, len, newfile, mark) } /* - * replace line lnum, with buffering, in current buffer + * Replace line lnum, with buffering, in current buffer. * * If copy is TRUE, make a copy of the line, otherwise the line has been * copied to allocated memory already. @@ -2643,7 +2683,7 @@ ml_replace(lnum, line, copy) } /* - * delete line 'lnum' + * Delete line 'lnum' in the current buffer. * * Check: The caller of this function should probably also call * deleted_lines() after this. @@ -4114,7 +4154,9 @@ findswapname(buf, dirp, old_fname) #endif { MSG_PUTS("\n"); - need_wait_return = TRUE; /* call wait_return later */ + if (msg_silent == 0) + /* call wait_return() later */ + need_wait_return = TRUE; } #ifdef CREATE_DUMMY_FILE diff --git a/src/message.c b/src/message.c index 8ea49ae200..465b25e7e7 100644 --- a/src/message.c +++ b/src/message.c @@ -752,7 +752,7 @@ add_msg_hist(s, len, attr) return; /* Don't let the message history get too big */ - while (msg_hist_len > 20) + while (msg_hist_len > MAX_MSG_HIST_LEN) (void)delete_first_msg(); /* allocate an entry and add the message at the end of the history */ diff --git a/src/misc1.c b/src/misc1.c index a5a1805c2b..08cd20c91d 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -7952,6 +7952,10 @@ preserve_exit() prepare_to_exit(); + /* Setting this will prevent free() calls. That avoids calling free() + * recursively when free() was invoked with a bad pointer. */ + really_exiting = TRUE; + out_str(IObuff); screen_start(); /* don't know where cursor is now */ out_flush(); diff --git a/src/misc2.c b/src/misc2.c index c3f2b37989..f5b13e7629 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1426,13 +1426,15 @@ copy_option_part(option, buf, maxlen, sep_chars) } /* - * replacement for free() that ignores NULL pointers + * Replacement for free() that ignores NULL pointers. + * Also skip free() when exiting for sure, this helps when we caught a deadly + * signal that was caused by a crash in free(). */ void vim_free(x) void *x; { - if (x != NULL) + if (x != NULL && !really_exiting) { #ifdef MEM_PROFILE mem_pre_free(&x); diff --git a/src/po/it.po b/src/po/it.po index ed25f47fcb..dba546c950 100644 --- a/src/po/it.po +++ b/src/po/it.po @@ -12,9 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: vim 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-08-25 09:30+0200\n" -"PO-Revision-Date: 2005-08-29 21:30+0200\n" +"POT-Creation-Date: 2006-01-03 16:07+0100\n" +"PO-Revision-Date: 2006-01-06 13:50+0100\n" "Last-Translator: Vlad Sandrini <marco@sandrini.biz>\n" "Language-Team: Italian" " Antonio Colombo <azc10@yahoo.com>" @@ -22,6 +21,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO_8859-1\n" "Content-Transfer-Encoding: 8-bit\n" +"Report-Msgid-Bugs-To: \n" msgid "E82: Cannot allocate any buffer, exiting..." msgstr "E82: Non riesco ad allocare alcun buffer, esco..." @@ -254,8 +254,8 @@ msgstr " Completamento linea comandi (^V^N^P)" msgid " User defined completion (^U^N^P)" msgstr " Completamento definito dall'utente (^U^N^P)" -msgid " Occult completion (^O^N^P)" -msgstr " Completamento nascosto (^O^N^P)" +msgid " Omni completion (^O^N^P)" +msgstr " Completamento globale (^O^N^P)" msgid " Spelling suggestion (^S^N^P)" msgstr " Suggerimento ortografico (^S^N^P)" @@ -267,10 +267,10 @@ msgid "Hit end of paragraph" msgstr "Giunto alla fine del paragrafo" msgid "'dictionary' option is empty" -msgstr "l'opzione 'dictionary' è vuota" +msgstr "l'opzione 'dictionary' non è impostata" msgid "'thesaurus' option is empty" -msgstr "l'opzione 'thesaurus' è vuota" +msgstr "l'opzione 'thesaurus' non è impostata" #, c-format msgid "Scanning dictionary: %s" @@ -1131,21 +1131,8 @@ msgstr "E177: Non si può specificare due volte il contatore" msgid "E178: Invalid default value for count" msgstr "E178: Valore predefinito del contatore non valido" -msgid "E179: argument required for complete" -msgstr "E179: argomento necessario per complete" - -#, c-format -msgid "E180: Invalid complete value: %s" -msgstr "E180: Valore %s non valido per 'complete'" - -msgid "E468: Completion argument only allowed for custom completion" -msgstr "" -"E468: Argomento di completamento permesso solo per completamento " -"personalizzato" - -msgid "E467: Custom completion requires a function argument" -msgstr "" -"E467: Il completamento personalizzato richiede un argomento di funzione" +msgid "E179: argument required for -complete" +msgstr "E179: argomento necessario per -complete" #, c-format msgid "E181: Invalid attribute: %s" @@ -1163,6 +1150,19 @@ msgid "E184: No such user-defined command: %s" msgstr "E184: Comando definito dall'utente %s inesistente" #, c-format +msgid "E180: Invalid complete value: %s" +msgstr "E180: Valore %s non valido per 'complete'" + +msgid "E468: Completion argument only allowed for custom completion" +msgstr "" +"E468: Argomento di completamento permesso solo per completamento " +"personalizzato" + +msgid "E467: Custom completion requires a function argument" +msgstr "" +"E467: Il completamento personalizzato richiede un argomento di funzione" + +#, c-format msgid "E185: Cannot find color scheme %s" msgstr "E185: Non riesco a trovare schema colore %s" @@ -1420,6 +1420,12 @@ msgstr "non è un file" msgid "[New File]" msgstr "[File nuovo]" +msgid "[New DIRECTORY]" +msgstr "[Nuova DIRECTORY]" + +msgid "[File too big]" +msgstr "[File troppo grande]" + msgid "[Permission Denied]" msgstr "[Tipo di accesso non consentito]" @@ -1469,8 +1475,9 @@ msgstr "[convertito]" msgid "[crypted]" msgstr "[cifrato]" -msgid "[CONVERSION ERROR]" -msgstr "[ERRORE DI CONVERSIONE]" +#, c-format +msgid "[CONVERSION ERROR in line %ld]" +msgstr "[ERRORE DI CONVERSIONE alla linea %ld]" #, c-format msgid "[ILLEGAL BYTE in line %ld]" @@ -3024,25 +3031,6 @@ msgstr "" msgid "--socketid <xid>\tOpen Vim inside another GTK widget" msgstr "--socketid <xid>\tApri Vim dentro un altro 'widget' GTK" -msgid "" -"\n" -"Arguments recognised by kvim (KDE version):\n" -msgstr "" -"\n" -"Argomenti accettati da kvim (versione KDE):\n" - -msgid "-black\t\tUse reverse video" -msgstr "-black\t\tUsa colori invertiti" - -msgid "-tip\t\t\tDisplay the tip dialog on startup" -msgstr "-tip\t\t\tMostra la finestra consigli all'avvio" - -msgid "-notip\t\tDisable the tip dialog" -msgstr "-notip\t\tDisabilita la finestra consigli" - -msgid "--display <display>\tRun vim on <display>" -msgstr "--display <schermo>\tEsegui vim su <schermo>" - msgid "-P <parent title>\tOpen Vim inside parent application" msgstr "-P <titolo padre>\tApri Vim in un'applicazione padre" @@ -3468,6 +3456,10 @@ msgstr "Dimensione 'stack' aumentata" msgid "E317: pointer block id wrong 2" msgstr "E317: ID blocco puntatori errato 2" +#, c-format +msgid "E773: Symlink loop for \"%s\"" +msgstr "E773: Collegamento ricorsivo per \"%s\"" + msgid "E325: ATTENTION" msgstr "E325: ATTENZIONE" @@ -3641,6 +3633,10 @@ msgstr "Interruzione: " msgid "Press ENTER or type command to continue" msgstr "Premi INVIO o un comando per proseguire" +#, c-format +msgid "%s line %ld" +msgstr "%s linea %ld" + msgid "-- More --" msgstr "-- Ancora --" @@ -3830,6 +3826,12 @@ msgstr "E658: Connessione NetBeans persa per il buffer %ld" msgid "E505: " msgstr "E505: " +msgid "E774: 'operatorfunc' is empty" +msgstr "E774: opzione 'operatorfunc' non impostata" + +msgid "E775: Eval feature not avail |