From cd5139dfd38b000e07f5717fdc3bbc030a5ab497 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Feb 2011 11:57:04 +0100 Subject: [PATCH 1/6] updated for version 7.3.120 Problem: The message for an existing swap file is too long to fit in a 25 line terminal. Solution: Make the message shorter. (Chad Miller) --- src/memline.c | 6 +++--- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/memline.c b/src/memline.c index 410b1161b6..f70e8e32be 100644 --- a/src/memline.c +++ b/src/memline.c @@ -4071,9 +4071,9 @@ attention_message(buf, fname) } /* Some of these messages are long to allow translation to * other languages. */ - MSG_PUTS(_("\n(1) Another program may be editing the same file.\n If this is the case, be careful not to end up with two\n different instances of the same file when making changes.\n")); - MSG_PUTS(_(" Quit, or continue with caution.\n")); - MSG_PUTS(_("\n(2) An edit session for this file crashed.\n")); + MSG_PUTS(_("\n(1) Another program may be editing the same file. If this is the case,\n be careful not to end up with two different instances of the same\n file when making changes.")); + MSG_PUTS(_(" Quit, or continue with caution.\n")); + MSG_PUTS(_("(2) An edit session for this file crashed.\n")); MSG_PUTS(_(" If this is the case, use \":recover\" or \"vim -r ")); msg_outtrans(buf->b_fname); MSG_PUTS(_("\"\n to recover the changes (see \":help recovery\").\n")); diff --git a/src/version.c b/src/version.c index 962aa5cf52..cbb1ac7225 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 120, /**/ 119, /**/ From 00c19fd486a3b5e034c423f1fab62b88dd4b254b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Feb 2011 14:24:46 +0100 Subject: [PATCH 2/6] updated for version 7.3.121 Problem: Complicated 'statusline' causes a crash. (Christian Brabandt) Solution: Check that the number of items is not too big. --- src/buffer.c | 12 ++++++++++++ src/version.c | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index e91b7c847e..420b5ea914 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3460,6 +3460,18 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, prevchar_isitem = FALSE; for (s = usefmt; *s; ) { + if (curitem == STL_MAX_ITEM) + { + /* There are too many items. Add the error code to the statusline + * to give the user a hint about what went wrong. */ + if (p + 6 < out + outlen) + { + mch_memmove(p, " E541", (size_t)5); + p += 5; + } + break; + } + if (*s != NUL && *s != '%') prevchar_isflag = prevchar_isitem = FALSE; diff --git a/src/version.c b/src/version.c index cbb1ac7225..97170e6274 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 121, /**/ 120, /**/ From eaee7938b08df8219dc5f7eb2c04e29e86437e9f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Feb 2011 15:28:09 +0100 Subject: [PATCH 3/6] updated for version 7.3.122 Problem: Having auto/config.mk in the repository causes problems. Solution: Remove auto/config.mk from the distribution. In the toplevel Makefile copy it from the "dist" file. --- .hgignore | 5 +++-- Makefile | 6 ++++++ src/Makefile | 11 ++++++----- src/auto/config.mk | 5 ----- src/version.c | 2 ++ 5 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 src/auto/config.mk diff --git a/.hgignore b/.hgignore index f676fbae90..b70d5e27b2 100644 --- a/.hgignore +++ b/.hgignore @@ -7,14 +7,15 @@ src/xxd/xxd src/auto/if_perl.c src/tags -# We do need src/auto/configure and src/auto/config.mk. -src/auto/osdef.h +# We do need src/auto/configure. src/auto/config.aap src/auto/config.cache src/auto/config.h src/auto/config.log +src/auto/config.mk src/auto/config.status src/auto/configure.aap +src/auto/osdef.h src/auto/link.log src/auto/link.sed src/auto/pathdef.c diff --git a/Makefile b/Makefile index bf2b30925c..a48112eca3 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ # has run can result in compiling with $(CC) empty. first: + @if test ! -f src/auto/config.mk; then \ + cp src/config.mk.dist src/auto/config.mk; \ + fi @echo "Starting make in the src directory." @echo "If there are problems, cd to the src directory and run make there" cd src && $(MAKE) $@ @@ -30,6 +33,9 @@ first: # Some make programs use the last target for the $@ default; put the other # targets separately to always let $@ expand to "first" by default. all install uninstall tools config configure reconfig proto depend lint tags types test testclean clean distclean: + @if test ! -f src/auto/config.mk; then \ + cp src/config.mk.dist src/auto/config.mk; \ + fi @echo "Starting make in the src directory." @echo "If there are problems, cd to the src directory and run make there" cd src && $(MAKE) $@ diff --git a/src/Makefile b/src/Makefile index 8f47f45d65..6d0e185317 100644 --- a/src/Makefile +++ b/src/Makefile @@ -283,12 +283,13 @@ CC= ######################## auto/config.mk ######################## {{{1 # At this position auto/config.mk is included. When starting from the -# distribution it is almost empty. After running auto/configure it contains -# settings that have been discovered for your system. Settings below this -# include override settings in auto/config.mk! +# toplevel Makefile it is almost empty. After running auto/configure it +# contains settings that have been discovered for your system. Settings below +# this include override settings in auto/config.mk! -# Note: if auto/config.mk is lost somehow (e.g., because configure was -# interrupted), create an empty auto/config.mk file and do "make config". +# Note: If make fails because auto/config.mk does not exist (it is not +# included in the repository), do: +# cp config.mk.dist auto/config.mk # (X) How to include auto/config.mk depends on the version of "make" you have, # if the current choice doesn't work, try the other one. diff --git a/src/auto/config.mk b/src/auto/config.mk deleted file mode 100644 index fa7c108505..0000000000 --- a/src/auto/config.mk +++ /dev/null @@ -1,5 +0,0 @@ -the first targets to make vim are: scratch config myself -srcdir = . -VIMNAME = vim -EXNAME = ex -VIEWNAME = view diff --git a/src/version.c b/src/version.c index 97170e6274..2827368983 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 122, /**/ 121, /**/ From 5e69f973fd0c5f560d61302deb58dcd06191d15b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Feb 2011 16:29:59 +0100 Subject: [PATCH 4/6] updated for version 7.3.123 Problem: ml_get error when executing register being recorded into, deleting lines and 'conceallevel' is set. (ZyX) Solution: Don't redraw a line for concealing when it doesn't exist. --- src/main.c | 4 +++- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 895a435992..c79d2b8c87 100644 --- a/src/main.c +++ b/src/main.c @@ -1198,7 +1198,9 @@ main_loop(cmdwin, noexmode) || conceal_cursor_line(curwin) || need_cursor_line_redraw)) { - if (conceal_old_cursor_line != conceal_new_cursor_line) + if (conceal_old_cursor_line != conceal_new_cursor_line + && conceal_old_cursor_line + <= curbuf->b_ml.ml_line_count) update_single_line(curwin, conceal_old_cursor_line); update_single_line(curwin, conceal_new_cursor_line); curwin->w_valid &= ~VALID_CROW; diff --git a/src/version.c b/src/version.c index 2827368983..34ef920176 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 123, /**/ 122, /**/ From 1fd163bd8248fc6b77ef413abc3deebb275d2466 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Feb 2011 17:39:22 +0100 Subject: [PATCH 5/6] updated for version 7.3.124 Problem: When writing a file in binary mode it may be missing the final EOL if a file previously read was missing the EOL. (Kevin Goodsell) Solution: Move the write_no_eol_lnum into the buffer struct. --- src/fileio.c | 23 +++++++++++++---------- src/globals.h | 4 ---- src/os_unix.c | 6 +++--- src/structs.h | 3 +++ src/version.c | 2 ++ 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 0d4511ad5d..a87b70b8bb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -317,7 +317,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags) int using_b_fname; #endif - write_no_eol_lnum = 0; /* in case it was set by the previous read */ + curbuf->b_no_eol_lnum = 0; /* in case it was set by the previous read */ /* * If there is no file name yet, use the one for the read file. @@ -2599,10 +2599,11 @@ failed: /* * Trick: We remember if the last line of the read didn't have - * an eol for when writing it again. This is required for + * an eol even when 'binary' is off, for when writing it again with + * 'binary' on. This is required for * ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work. */ - write_no_eol_lnum = read_no_eol_lnum; + curbuf->b_no_eol_lnum = read_no_eol_lnum; /* When reloading a buffer put the cursor at the first line that is * different. */ @@ -2650,13 +2651,17 @@ failed: FALSE, NULL, eap); if (msg_scrolled == n) msg_scroll = m; -#ifdef FEAT_EVAL +# ifdef FEAT_EVAL if (aborting()) /* autocmds may abort script processing */ return FAIL; -#endif +# endif } #endif + /* Reset now, following writes should not omit the EOL. Also, the line + * number will become invalid because of edits. */ + curbuf->b_no_eol_lnum = 0; + if (recoverymode && error) return FAIL; return OK; @@ -4560,7 +4565,7 @@ restore_backup: if (end == 0 || (lnum == end && write_bin - && (lnum == write_no_eol_lnum + && (lnum == buf->b_no_eol_lnum || (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol)))) { ++lnum; /* written the line, count it */ @@ -5086,8 +5091,6 @@ nofail: { aco_save_T aco; - write_no_eol_lnum = 0; /* in case it was set by the previous read */ - /* * Apply POST autocommands. * Careful: The autocommands may call buf_write() recursively! @@ -7256,8 +7259,8 @@ buf_store_time(buf, st, fname) write_lnum_adjust(offset) linenr_T offset; { - if (write_no_eol_lnum != 0) /* only if there is a missing eol */ - write_no_eol_lnum += offset; + if (curbuf->b_no_eol_lnum != 0) /* only if there is a missing eol */ + curbuf->b_no_eol_lnum += offset; } #if defined(TEMPDIRNAMES) || defined(PROTO) diff --git a/src/globals.h b/src/globals.h index 84aaa06ada..3685fc7322 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1057,10 +1057,6 @@ EXTERN pos_T last_cursormoved /* for CursorMoved event */ ; #endif -EXTERN linenr_T write_no_eol_lnum INIT(= 0); /* non-zero lnum when last line - of next binary write should - not have an end-of-line */ - #ifdef FEAT_WINDOWS EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */ EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */ diff --git a/src/os_unix.c b/src/os_unix.c index 0234f90d11..b227c8ea94 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4245,7 +4245,7 @@ mch_call_shell(cmd, options) * should not have one. */ if (lnum != curbuf->b_op_end.lnum || !curbuf->b_p_bin - || (lnum != write_no_eol_lnum + || (lnum != curbuf->b_no_eol_lnum && (lnum != curbuf->b_ml.ml_line_count || curbuf->b_p_eol))) @@ -4588,10 +4588,10 @@ finished: { append_ga_line(&ga); /* remember that the NL was missing */ - write_no_eol_lnum = curwin->w_cursor.lnum; + curbuf->b_no_eol_lnum = curwin->w_cursor.lnum; } else - write_no_eol_lnum = 0; + curbuf->b_no_eol_lnum = 0; ga_clear(&ga); } diff --git a/src/structs.h b/src/structs.h index aa93aaedcd..afc494e2cf 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1564,6 +1564,9 @@ struct file_buffer /* end of buffer options */ + linenr_T b_no_eol_lnum; /* non-zero lnum when last line of next binary + * write should not have an end-of-line */ + int b_start_eol; /* last line had eol when it was read */ int b_start_ffc; /* first char of 'ff' when edit started */ #ifdef FEAT_MBYTE diff --git a/src/version.c b/src/version.c index 34ef920176..ad439e13eb 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 124, /**/ 123, /**/ From cd6a821ac50199b30be5be0258ffd25ecc461342 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Feb 2011 18:06:15 +0100 Subject: [PATCH 6/6] updated for version 7.3.125 Problem: MSVC: Problem with quotes in link argument. Solution: Escape backslashes and quotes. (Weasley) --- src/Make_mvc.mak | 6 +++++- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 5b25004b16..7b56243835 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -1159,6 +1159,10 @@ $(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL) E0_CFLAGS = $(CFLAGS:\=\\) E_CFLAGS = $(E0_CFLAGS:"=\") # ") stop the string +# $LINKARGS2 may contain backslashes and double quotes, escape them both. +E0_LINKARGS2 = $(LINKARGS2:\=\\) +E_LINKARGS2 = $(E0_LINKARGS2:"=\") +# ") stop the string $(PATHDEF_SRC): auto @echo creating $(PATHDEF_SRC) @@ -1167,7 +1171,7 @@ $(PATHDEF_SRC): auto @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC) - @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC) + @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC) @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC) @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC) diff --git a/src/version.c b/src/version.c index ad439e13eb..c4fe28e150 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 125, /**/ 124, /**/