From 6fc6eba1da80d702d24189396ddc674d876f0907 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 04:19:34 +0100 Subject: [PATCH 001/105] updated for version 7.4.053 Problem: Test75 has a wrong header. (ZyX) Solution: Fix the text and remove leading ". --- src/testdir/test75.in | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test75.in b/src/testdir/test75.in index f43970dc62..4bd8279a36 100644 --- a/src/testdir/test75.in +++ b/src/testdir/test75.in @@ -1,4 +1,4 @@ -" Tests for functions. +Tests for maparg(). STARTTEST :so small.vim diff --git a/src/version.c b/src/version.c index c6b464c746..1e4766a395 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 53, /**/ 52, /**/ From 1242a35c71314d5b2c3238594042e46ca1b6378b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 04:19:34 +0100 Subject: [PATCH 002/105] Added tag v7-4-053 for changeset 733193bf24c3 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index f1fa4ee1cf..3a37360167 100644 --- a/.hgtags +++ b/.hgtags @@ -2775,3 +2775,4 @@ c21b2f52f1dd003d860e3b574602ed3fdc2b4f1c v7-4-047 eb33cadafcabfc9cb3fc0741e169e84cafec11f8 v7-4-050 e7a2f217a385e6aebfddc4d29182924ac017d262 v7-4-051 b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 +733193bf24c3a80883c60964922c7cdc83662eb2 v7-4-053 From 99958cb8a9b44026525c37a433f57424977aea3f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 04:39:38 +0100 Subject: [PATCH 003/105] updated for version 7.4.054 Problem: Reading past end of the 'stl' string. Solution: Don't increment pointer when already at the NUL. (Christian Brabandt) --- src/buffer.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index 34273d83b5..7b02ddaf57 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4062,7 +4062,8 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, item[curitem].minwid = -syn_namen2id(t, (int)(s - t)); curitem++; } - ++s; + if (*s != NUL) + ++s; continue; } diff --git a/src/version.c b/src/version.c index 1e4766a395..c22172525d 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 54, /**/ 53, /**/ From fb4a6d8165a1210c74c9b509b138e93a9063ede4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 04:39:39 +0100 Subject: [PATCH 004/105] Added tag v7-4-054 for changeset 7b760cda2bbf --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3a37360167..bef6e17645 100644 --- a/.hgtags +++ b/.hgtags @@ -2776,3 +2776,4 @@ eb33cadafcabfc9cb3fc0741e169e84cafec11f8 v7-4-050 e7a2f217a385e6aebfddc4d29182924ac017d262 v7-4-051 b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 733193bf24c3a80883c60964922c7cdc83662eb2 v7-4-053 +7b760cda2bbf086ba975fd5a4bdc6190a0f08caf v7-4-054 From d24a4990385a7a561882514222697503a8c6d30f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 21:04:38 +0100 Subject: [PATCH 005/105] =?UTF-8?q?updated=20for=20version=207.4.055=20Pro?= =?UTF-8?q?blem:=20=20=20=20Mac:=20Where=20availability=20macros=20are=20d?= =?UTF-8?q?efined=20depends=20on=20the=20system.=20Solution:=20=20=20Add?= =?UTF-8?q?=20a=20configure=20check.=20(Felix=20B=C3=BCnemann)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auto/configure | 13 +++++++++++-- src/config.h.in | 3 +++ src/configure.in | 4 ++++ src/os_mac.h | 7 ++++++- src/version.c | 2 ++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 07f794e8fc..9f43e8de27 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4223,7 +4223,7 @@ rm -f core conftest.err conftest.$ac_objext \ OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" - # On IRIX 5.3, sys/types and inttypes.h are conflicting. + # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : @@ -4241,7 +4241,16 @@ fi done -ac_fn_c_check_header_mongrel "$LINENO" "Carbon/Carbon.h" "ac_cv_header_Carbon_Carbon_h" "$ac_includes_default" +ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" +if test "x$ac_cv_header_AvailabilityMacros_h" = x""yes; then : + +$as_echo "#define HAVE_AVAILABILITYMACROS_H 1" >>confdefs.h + +fi + + + + ac_fn_c_check_header_mongrel "$LINENO" "Carbon/Carbon.h" "ac_cv_header_Carbon_Carbon_h" "$ac_includes_default" if test "x$ac_cv_header_Carbon_Carbon_h" = x""yes; then : CARBON=yes fi diff --git a/src/config.h.in b/src/config.h.in index 422fd1fc79..a4e216bbcc 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -442,3 +442,6 @@ /* Define if you want Cygwin to use the WIN32 clipboard, not compatible with X11*/ #undef FEAT_CYGWIN_WIN32_CLIPBOARD + +/* Define if we have AvailabilityMacros.h on Mac OS X */ +#undef HAVE_AVAILABILITYMACROS_H diff --git a/src/configure.in b/src/configure.in index 11e1d63d96..73470fc7db 100644 --- a/src/configure.in +++ b/src/configure.in @@ -206,6 +206,10 @@ if test "`(uname) 2>/dev/null`" = Darwin; then dnl TODO: use -arch i386 on Intel machines CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon + dnl so we need to include it to have access to version macros. + AC_CHECK_HEADER(AvailabilityMacros.h, [AC_DEFINE(HAVE_AVAILABILITYMACROS_H, 1, [ Define if we have AvailabilityMacros.h on Mac OS X ])]) + dnl If Carbon is found, assume we don't want X11 dnl unless it was specifically asked for (--with-x) dnl or Motif, Athena or GTK GUI is used. diff --git a/src/os_mac.h b/src/os_mac.h index 78b79c2e16..c13a30158c 100644 --- a/src/os_mac.h +++ b/src/os_mac.h @@ -16,6 +16,11 @@ # define OPAQUE_TOOLBOX_STRUCTS 0 #endif +/* Include MAC_OS_X_VERSION_* macros */ +#ifdef HAVE_AVAILABILITYMACROS_H +# include +#endif + /* * Macintosh machine-dependent things. * @@ -263,7 +268,7 @@ #endif /* Some "prep work" definition to be able to compile the MacOS X - * version with os_unix.x instead of os_mac.c. Based on the result + * version with os_unix.c instead of os_mac.c. Based on the result * of ./configure for console MacOS X. */ diff --git a/src/version.c b/src/version.c index c22172525d..184aee76d1 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 55, /**/ 54, /**/ From 8071e4cfd4d64b6cd4ee697a18cac65be914a8f3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 21:04:38 +0100 Subject: [PATCH 006/105] Added tag v7-4-055 for changeset 38a755adc580 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bef6e17645..2c3bbba0a9 100644 --- a/.hgtags +++ b/.hgtags @@ -2777,3 +2777,4 @@ e7a2f217a385e6aebfddc4d29182924ac017d262 v7-4-051 b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 733193bf24c3a80883c60964922c7cdc83662eb2 v7-4-053 7b760cda2bbf086ba975fd5a4bdc6190a0f08caf v7-4-054 +38a755adc58063894c6695d702cc37f4910bad14 v7-4-055 From ddd1489e5619f17c7f3a4eaa7c05dd60a7bd98c0 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 21:49:32 +0100 Subject: [PATCH 007/105] updated for version 7.4.056 Problem: Mac: Compilation problem with OS X 10.9 Mavericks. Solution: Include AvailabilityMacros.h when available. (Kazunobu Kuriyama) --- src/os_unix.c | 6 ++++++ src/version.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/os_unix.c b/src/os_unix.c index cc026534d3..80459c94eb 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -804,6 +804,12 @@ mch_stackcheck(p) * completely full. */ +#if defined(HAVE_AVAILABILITYMACROS_H) \ + && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \ + && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090) +# include +#endif + #ifndef SIGSTKSZ # define SIGSTKSZ 8000 /* just a guess of how much stack is needed... */ #endif diff --git a/src/version.c b/src/version.c index 184aee76d1..c682508936 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 56, /**/ 55, /**/ From 067b89de5aa3512d0e018a26f431243333ab2d96 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 21:49:32 +0100 Subject: [PATCH 008/105] Added tag v7-4-056 for changeset 8d83c219fc7b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 2c3bbba0a9..69eaebeb9f 100644 --- a/.hgtags +++ b/.hgtags @@ -2778,3 +2778,4 @@ b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 733193bf24c3a80883c60964922c7cdc83662eb2 v7-4-053 7b760cda2bbf086ba975fd5a4bdc6190a0f08caf v7-4-054 38a755adc58063894c6695d702cc37f4910bad14 v7-4-055 +8d83c219fc7b2ec8685ab9e0dd7d3067b7f9d1e9 v7-4-056 From 9e784a64f2971c8e996bc35efdda4204a2c10754 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 23:29:26 +0100 Subject: [PATCH 009/105] updated for version 7.4.057 Problem: byteidx() does not work for composing characters. Solution: Add byteidxcomp(). --- runtime/doc/eval.txt | 21 +++++++++++++++++++-- src/eval.c | 36 +++++++++++++++++++++++++++++++----- src/testdir/test69.in | 16 ++++++++++++++++ src/testdir/test69.ok | 8 ++++++++ src/version.c | 2 ++ 5 files changed, 76 insertions(+), 7 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 60b01a8bf4..650688bc4b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1713,6 +1713,7 @@ bufnr( {expr}) Number Number of the buffer {expr} bufwinnr( {expr}) Number window number of buffer {expr} byte2line( {byte}) Number line number at byte count {byte} byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr} +byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr} call( {func}, {arglist} [, {dict}]) any call {func} with arguments {arglist} ceil( {expr}) Float round {expr} up @@ -2261,7 +2262,10 @@ byteidx({expr}, {nr}) *byteidx()* {expr}. Use zero for the first character, it returns zero. This function is only useful when there are multibyte characters, otherwise the returned value is equal to {nr}. - Composing characters are counted as a separate character. + Composing characters are not counted separately, their byte + length is added to the preceding base character. See + |byteidxcomp()| below for counting composing characters + separately. Example : > echo matchstr(str, ".", byteidx(str, 3)) < will display the fourth character. Another way to do the @@ -2270,7 +2274,20 @@ byteidx({expr}, {nr}) *byteidx()* echo strpart(s, 0, byteidx(s, 1)) < If there are less than {nr} characters -1 is returned. If there are exactly {nr} characters the length of the string - is returned. + in bytes is returned. + +byteidxcomp({expr}, {nr}) *byteidxcomp()* + Like byteidx(), except that a composing character is counted + as a separate character. Example: > + let s = 'e' . nr2char(0x301) + echo byteidx(s, 1) + echo byteidxcomp(s, 1) + echo byteidxcomp(s, 2) +< The first and third echo result in 3 ('e' plus composing + character is 3 bytes), the second echo results in 1 ('e' is + one byte). + Only works different from byteidx() when 'encoding' is set to + a Unicode encoding. call({func}, {arglist} [, {dict}]) *call()* *E699* Call function {func} with the items in |List| {arglist} as diff --git a/src/eval.c b/src/eval.c index c3ac4673db..0468203cca 100644 --- a/src/eval.c +++ b/src/eval.c @@ -474,7 +474,9 @@ static void f_bufname __ARGS((typval_T *argvars, typval_T *rettv)); static void f_bufnr __ARGS((typval_T *argvars, typval_T *rettv)); static void f_bufwinnr __ARGS((typval_T *argvars, typval_T *rettv)); static void f_byte2line __ARGS((typval_T *argvars, typval_T *rettv)); +static void byteidx __ARGS((typval_T *argvars, typval_T *rettv, int comp)); static void f_byteidx __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_byteidxcomp __ARGS((typval_T *argvars, typval_T *rettv)); static void f_call __ARGS((typval_T *argvars, typval_T *rettv)); #ifdef FEAT_FLOAT static void f_ceil __ARGS((typval_T *argvars, typval_T *rettv)); @@ -7861,6 +7863,7 @@ static struct fst {"bufwinnr", 1, 1, f_bufwinnr}, {"byte2line", 1, 1, f_byte2line}, {"byteidx", 2, 2, f_byteidx}, + {"byteidxcomp", 2, 2, f_byteidxcomp}, {"call", 2, 3, f_call}, #ifdef FEAT_FLOAT {"ceil", 1, 1, f_ceil}, @@ -9177,13 +9180,11 @@ f_byte2line(argvars, rettv) #endif } -/* - * "byteidx()" function - */ static void -f_byteidx(argvars, rettv) +byteidx(argvars, rettv, comp) typval_T *argvars; typval_T *rettv; + int comp; { #ifdef FEAT_MBYTE char_u *t; @@ -9203,7 +9204,10 @@ f_byteidx(argvars, rettv) { if (*t == NUL) /* EOL reached */ return; - t += (*mb_ptr2len)(t); + if (enc_utf8 && comp) + t += utf_ptr2len(t); + else + t += (*mb_ptr2len)(t); } rettv->vval.v_number = (varnumber_T)(t - str); #else @@ -9212,6 +9216,28 @@ f_byteidx(argvars, rettv) #endif } +/* + * "byteidx()" function + */ + static void +f_byteidx(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + byteidx(argvars, rettv, FALSE); +} + +/* + * "byteidxcomp()" function + */ + static void +f_byteidxcomp(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + byteidx(argvars, rettv, TRUE); +} + int func_call(name, args, selfdict, rettv) char_u *name; diff --git a/src/testdir/test69.in b/src/testdir/test69.in index 9558cb8178..f18ee37905 100644 --- a/src/testdir/test69.in +++ b/src/testdir/test69.in @@ -1,6 +1,7 @@ Test for multi-byte text formatting. Also test, that 'mps' with multibyte chars works. And test "ra" on multi-byte characters. +Also test byteidx() and byteidxcomp() STARTTEST :so mbyte.vim @@ -153,6 +154,21 @@ ra test abba aab +STARTTEST +:let a = '.é.' " one char of two bytes +:let b = '.é.' " normal e with composing char +/^byteidx +:put =string([byteidx(a, 0), byteidx(a, 1), byteidx(a, 2), byteidx(a, 3), byteidx(a, 4)]) +:put =string([byteidx(b, 0), byteidx(b, 1), byteidx(b, 2), byteidx(b, 3), byteidx(b, 4)]) +/^byteidxcomp +:put =string([byteidxcomp(a, 0), byteidxcomp(a, 1), byteidxcomp(a, 2), byteidxcomp(a, 3), byteidxcomp(a, 4)]) +:let b = '.é.' +:put =string([byteidxcomp(b, 0), byteidxcomp(b, 1), byteidxcomp(b, 2), byteidxcomp(b, 3), byteidxcomp(b, 4), byteidxcomp(b, 5)]) +ENDTEST + +byteidx +byteidxcomp + STARTTEST :g/^STARTTEST/.,/^ENDTEST/d :1;/^Results/,$wq! test.out diff --git a/src/testdir/test69.ok b/src/testdir/test69.ok index f742ee1740..1ff82f26bc 100644 --- a/src/testdir/test69.ok +++ b/src/testdir/test69.ok @@ -149,3 +149,11 @@ ra test aaaa aaa + +byteidx +[0, 1, 3, 4, -1] +[0, 1, 4, 5, -1] +byteidxcomp +[0, 1, 3, 4, -1] +[0, 1, 2, 4, 5, -1] + diff --git a/src/version.c b/src/version.c index c682508936..d76370f600 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 57, /**/ 56, /**/ From d162e259713781432587f028d129b780fab82f5b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 23:29:26 +0100 Subject: [PATCH 010/105] Added tag v7-4-057 for changeset 3109053ce4e3 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 69eaebeb9f..4fa67f57e7 100644 --- a/.hgtags +++ b/.hgtags @@ -2779,3 +2779,4 @@ b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 7b760cda2bbf086ba975fd5a4bdc6190a0f08caf v7-4-054 38a755adc58063894c6695d702cc37f4910bad14 v7-4-055 8d83c219fc7b2ec8685ab9e0dd7d3067b7f9d1e9 v7-4-056 +3109053ce4e3d17ca6ecab06c0ea0f38581d2f41 v7-4-057 From 3ca1b7fa6149a4dfe32cb28380409cfdcf892591 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 23:59:35 +0100 Subject: [PATCH 011/105] updated for version 7.4.058 Problem: Warnings on 64 bit Windows. Solution: Add type casts. (Mike Williams) --- src/ops.c | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ops.c b/src/ops.c index 91d3a4b0ff..4a198487cc 100644 --- a/src/ops.c +++ b/src/ops.c @@ -5009,14 +5009,14 @@ format_lines(line_count, avoid_fex) if (second_indent > 0) /* the "leader" for FO_Q_SECOND */ { char_u *p = ml_get_curline(); - int indent = skipwhite(p) - p; + int indent = (int)(skipwhite(p) - p); if (indent > 0) { (void)del_bytes(indent, FALSE, FALSE); mark_col_adjust(curwin->w_cursor.lnum, (colnr_T)0, 0L, (long)-indent); - } + } } curwin->w_cursor.lnum--; if (do_join(2, TRUE, FALSE, FALSE) == FAIL) diff --git a/src/version.c b/src/version.c index d76370f600..1db6ae92d6 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 58, /**/ 57, /**/ From 7d3c6856643bb3a46cedbb15ff4e6034f1f00667 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 2 Nov 2013 23:59:35 +0100 Subject: [PATCH 012/105] Added tag v7-4-058 for changeset fa8447ec5823 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 4fa67f57e7..5bdf3bde4a 100644 --- a/.hgtags +++ b/.hgtags @@ -2780,3 +2780,4 @@ b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 38a755adc58063894c6695d702cc37f4910bad14 v7-4-055 8d83c219fc7b2ec8685ab9e0dd7d3067b7f9d1e9 v7-4-056 3109053ce4e3d17ca6ecab06c0ea0f38581d2f41 v7-4-057 +fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 From 3dda014e5c14138a59ba368eeadf2f546fffa925 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 00:20:52 +0100 Subject: [PATCH 013/105] updated for version 7.4.059 Problem: set_last_cursor() may encounter w_buffer being NULL. (Matt Mkaniaris) Solution: Check for NULL. --- src/mark.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mark.c b/src/mark.c index 1ac91d8b1b..9c17f7afb7 100644 --- a/src/mark.c +++ b/src/mark.c @@ -1374,7 +1374,8 @@ free_jumplist(wp) set_last_cursor(win) win_T *win; { - win->w_buffer->b_last_cursor = win->w_cursor; + if (win->w_buffer != NULL) + win->w_buffer->b_last_cursor = win->w_cursor; } #if defined(EXITFREE) || defined(PROTO) diff --git a/src/version.c b/src/version.c index 1db6ae92d6..2d90185b71 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 59, /**/ 58, /**/ From a9ef76374f5151334c44b7417761daead629c4f3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 00:20:52 +0100 Subject: [PATCH 014/105] Added tag v7-4-059 for changeset 2a72805a3038 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5bdf3bde4a..a020c5035d 100644 --- a/.hgtags +++ b/.hgtags @@ -2781,3 +2781,4 @@ b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 8d83c219fc7b2ec8685ab9e0dd7d3067b7f9d1e9 v7-4-056 3109053ce4e3d17ca6ecab06c0ea0f38581d2f41 v7-4-057 fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 +2a72805a3038285c35f47dc0327a57cdabbdf09d v7-4-059 From aba97f4b08f6ebf0741b5938a4b5b78ab0e26e73 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 00:28:25 +0100 Subject: [PATCH 015/105] updated for version 7.4.060 Problem: Declaration has wrong return type for PyObject_SetAttrString(). Solution: Use int instead of PyObject. (Andreas Schwab) --- src/if_python.c | 2 +- src/if_python3.c | 2 +- src/version.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/if_python.c b/src/if_python.c index 6e43b5dc3d..e34bd280f1 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -359,7 +359,7 @@ static int(*dll_PyRun_SimpleString)(char *); static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *); static PyObject* (*dll_PyObject_GetAttrString)(PyObject *, const char *); static int (*dll_PyObject_HasAttrString)(PyObject *, const char *); -static PyObject* (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); +static int (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...); static PyObject* (*dll_PyObject_CallFunction)(PyObject *, char *, ...); static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *); diff --git a/src/if_python3.c b/src/if_python3.c index 8a5b3329e0..40bc97bc8c 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -302,7 +302,7 @@ static int (*py3_PyRun_SimpleString)(char *); static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *); static PyObject* (*py3_PyObject_GetAttrString)(PyObject *, const char *); static int (*py3_PyObject_HasAttrString)(PyObject *, const char *); -static PyObject* (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); +static int (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...); static PyObject* (*py3__PyObject_CallFunction_SizeT)(PyObject *, char *, ...); static PyObject* (*py3_PyObject_Call)(PyObject *, PyObject *, PyObject *); diff --git a/src/version.c b/src/version.c index 2d90185b71..0c5c5734e8 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 60, /**/ 59, /**/ From f4c8f7387ff7c496465178ba2be6d350fc39e71d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 00:28:25 +0100 Subject: [PATCH 016/105] Added tag v7-4-060 for changeset 46ca8fcee525 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index a020c5035d..4182da0e6c 100644 --- a/.hgtags +++ b/.hgtags @@ -2782,3 +2782,4 @@ b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 3109053ce4e3d17ca6ecab06c0ea0f38581d2f41 v7-4-057 fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 2a72805a3038285c35f47dc0327a57cdabbdf09d v7-4-059 +46ca8fcee5257cc036ac928d91b2a490cf47a956 v7-4-060 From bfa6c9ac5328f0cddf5e8aa8b24c63ef11176a84 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 00:41:00 +0100 Subject: [PATCH 017/105] updated for version 7.4.061 Problem: Availability macros configure check in wrong place. Solution: Also check when not using Darwin. Remove version check. --- src/auto/configure | 20 +++++++++----------- src/configure.in | 8 ++++---- src/os_unix.c | 4 +--- src/version.c | 2 ++ 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 9f43e8de27..75f76a6301 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4223,7 +4223,7 @@ rm -f core conftest.err conftest.$ac_objext \ OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" - # On IRIX 5.3, sys/types and inttypes.h are conflicting. + # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : @@ -4241,16 +4241,7 @@ fi done -ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" -if test "x$ac_cv_header_AvailabilityMacros_h" = x""yes; then : - -$as_echo "#define HAVE_AVAILABILITYMACROS_H 1" >>confdefs.h - -fi - - - - ac_fn_c_check_header_mongrel "$LINENO" "Carbon/Carbon.h" "ac_cv_header_Carbon_Carbon_h" "$ac_includes_default" +ac_fn_c_check_header_mongrel "$LINENO" "Carbon/Carbon.h" "ac_cv_header_Carbon_Carbon_h" "$ac_includes_default" if test "x$ac_cv_header_Carbon_Carbon_h" = x""yes; then : CARBON=yes fi @@ -4272,6 +4263,13 @@ else $as_echo "no" >&6; } fi +ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" +if test "x$ac_cv_header_AvailabilityMacros_h" = x""yes; then : + HAVE_AVAILABILITYMACROS_H=1 +fi + + + diff --git a/src/configure.in b/src/configure.in index 73470fc7db..ee70682b22 100644 --- a/src/configure.in +++ b/src/configure.in @@ -206,10 +206,6 @@ if test "`(uname) 2>/dev/null`" = Darwin; then dnl TODO: use -arch i386 on Intel machines CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" - dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon - dnl so we need to include it to have access to version macros. - AC_CHECK_HEADER(AvailabilityMacros.h, [AC_DEFINE(HAVE_AVAILABILITYMACROS_H, 1, [ Define if we have AvailabilityMacros.h on Mac OS X ])]) - dnl If Carbon is found, assume we don't want X11 dnl unless it was specifically asked for (--with-x) dnl or Motif, Athena or GTK GUI is used. @@ -232,6 +228,10 @@ else AC_MSG_RESULT(no) fi +dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon +dnl so we need to include it to have access to version macros. +AC_CHECK_HEADER(AvailabilityMacros.h, HAVE_AVAILABILITYMACROS_H=1) + AC_SUBST(OS_EXTRA_SRC) AC_SUBST(OS_EXTRA_OBJ) diff --git a/src/os_unix.c b/src/os_unix.c index 80459c94eb..5eb0936c88 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -804,9 +804,7 @@ mch_stackcheck(p) * completely full. */ -#if defined(HAVE_AVAILABILITYMACROS_H) \ - && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \ - && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090) +#if defined(HAVE_AVAILABILITYMACROS_H) # include #endif diff --git a/src/version.c b/src/version.c index 0c5c5734e8..5ef4c228cc 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 61, /**/ 60, /**/ From f2cee604c82fa3bcd81764d8a81dbd870daf0889 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 00:41:00 +0100 Subject: [PATCH 018/105] Added tag v7-4-061 for changeset 739074bdceb8 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 4182da0e6c..5a2ef9f569 100644 --- a/.hgtags +++ b/.hgtags @@ -2783,3 +2783,4 @@ b9c1c1f4cda9b82a2e703feec441d865b4722d56 v7-4-052 fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 2a72805a3038285c35f47dc0327a57cdabbdf09d v7-4-059 46ca8fcee5257cc036ac928d91b2a490cf47a956 v7-4-060 +739074bdceb85d16b9e70791d91a59c2b846ed8d v7-4-061 From d54402da11e036a3cdc021bd02410f2d64f468fe Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 20:26:31 +0100 Subject: [PATCH 019/105] updated for version 7.4.062 Problem: Configure check for AvailabilityMacros.h is wrong. Solution: Use AC_CHECK_HEADERS(). --- src/auto/configure | 10 ++++++++-- src/configure.in | 2 +- src/version.c | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 75f76a6301..bb079f0fc0 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4263,11 +4263,17 @@ else $as_echo "no" >&6; } fi -ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" +for ac_header in AvailabilityMacros.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" if test "x$ac_cv_header_AvailabilityMacros_h" = x""yes; then : - HAVE_AVAILABILITYMACROS_H=1 + cat >>confdefs.h <<_ACEOF +#define HAVE_AVAILABILITYMACROS_H 1 +_ACEOF + fi +done diff --git a/src/configure.in b/src/configure.in index ee70682b22..df28a246b7 100644 --- a/src/configure.in +++ b/src/configure.in @@ -230,7 +230,7 @@ fi dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon dnl so we need to include it to have access to version macros. -AC_CHECK_HEADER(AvailabilityMacros.h, HAVE_AVAILABILITYMACROS_H=1) +AC_CHECK_HEADERS(AvailabilityMacros.h) AC_SUBST(OS_EXTRA_SRC) AC_SUBST(OS_EXTRA_OBJ) diff --git a/src/version.c b/src/version.c index 5ef4c228cc..229672a30b 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 62, /**/ 61, /**/ From 2c69999a692d1c47691839d097f0432de1f1f05b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 20:26:31 +0100 Subject: [PATCH 020/105] Added tag v7-4-062 for changeset d59a0b8e5584 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5a2ef9f569..5afbeba730 100644 --- a/.hgtags +++ b/.hgtags @@ -2784,3 +2784,4 @@ fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 2a72805a3038285c35f47dc0327a57cdabbdf09d v7-4-059 46ca8fcee5257cc036ac928d91b2a490cf47a956 v7-4-060 739074bdceb85d16b9e70791d91a59c2b846ed8d v7-4-061 +d59a0b8e5584c6e093990abb1b1e640aff7620bd v7-4-062 From 2a39887e2283da3b6aff73b19a481d1c5df99b47 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 3 Nov 2013 21:14:31 +0100 Subject: [PATCH 021/105] Update runtime files. --- runtime/doc/eval.txt | 2 +- runtime/doc/todo.txt | 99 +- runtime/doc/visual.txt | 8 +- runtime/filetype.vim | 9 +- runtime/ftplugin/j.vim | 7 +- runtime/ftplugin/lisp.vim | 5 +- runtime/ftplugin/scheme.vim | 5 +- runtime/syntax/clean.vim | 23 +- runtime/syntax/diff.vim | 4 +- runtime/syntax/dnsmasq.vim | 40 +- runtime/syntax/dts.vim | 6 +- runtime/syntax/j.vim | 6 +- runtime/syntax/upstreamlog.vim | 7 +- runtime/syntax/usserverlog.vim | 7 +- runtime/syntax/usw2kagtlog.vim | 7 +- runtime/vimlogo.eps | 1592 ++++++++++++++++---------------- src/po/uk.cp1251.po | 4 +- src/po/uk.po | 4 +- 18 files changed, 953 insertions(+), 882 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 650688bc4b..5085f21ae8 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2013 Aug 24 +*eval.txt* For Vim version 7.4. Last change: 2013 Nov 02 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index ae74a41d9f..d1d39742da 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2013 Oct 05 +*todo.txt* For Vim version 7.4. Last change: 2013 Nov 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,16 +34,16 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- -Problem positioning the cursor after auto-formatting without a comment. (Tor -Perkins, 2013 Sep 1) +Revert patch 7.4.056? Do it differently? Using \1 in pattern goes one line too far. (Bohr Shaw, 2013 Sep 5) Column is OK. "/\v(^.+\n)\1/e" (John Little, Sep 5) Also, matches start of 2nd line, not the whole line. -Error for incomplete help argument. (John Beckett, 2013 Sep 12) +NFA regexp doesn't handle backreference correctly. (Ryuichi Hayashida, 2013 +Oct 10) -Popup menu: first item is not selected when typing more than one character? +Error for incomplete help argument. (John Beckett, 2013 Sep 12) Should win_redr_custom() not be allowed to use recursively? (Yasuhiro Matsumoto, 2013 Aug 15) @@ -58,6 +58,16 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) Issue 164: freeze on regexp search. +Patch to Fix Python: DictionaryContains return -1 on error. (ZyX, 2013 Nov 1) + +Patch to fix that inserting CR when replacing a Visual block doesn't cause a +line break. (Christian Brabandt, 2013 Oct 19) +Check: does CTRL-V CR insert a literal CR? New patch Oct 21 +With test Oct 22. + +When recording the character typed at the hit-enter prompt is recorded twice. +(Urtica Dioica) Patch by Christian Brabandt, 2013 Oct 8. + Update for Clojure ftplugin. (Sung Pae). Await discussion about formatting in ftplugins. @@ -66,9 +76,29 @@ Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) Patch to avoid problem with colon in file name. (Yasuhiro Matsumoto, 2013 Sep 5) Only copy file name when needed: Sep 9. +After inserting comment leader, CTRL-\ CTRL-O does move the cursor. +(Wiktor Ruben, 2013 Oct 7) +Patch by Christian Brabandt. + +Patch to support slices in Python vim.List. (ZyX, 2013 Oct 20) + +Patch to support iterator on Python vim.options. (ZyX, 2013 Nov 2) + +Patch to avoid "-no-cpp-precomp" on Mac. (Misty De Meo, demeo, 2013 Oct 19) + +Patch to make Dictionary.update() work without arguments. +(ZyX, 2013 Oct 19) + Patch to make #N in 'cino' stop not indenting #lines. (Christian Brabandt, 2013 Sep 25) +Patch for Cobol ftplugin. (ZyX, 2013 Oct 20) +Await response from maintainer. + +Can 'undolevels' be a buffer-local option? Helps for making big changes in +one file only, set 'ul' to -1 only for that buffer. +Patch by Christian Brabandt, 2010 Dec 17. Needs test. + Include systemverilog file? Two votes yes. Wrapping around end of file does not work for "." after "cgn". (Dimitar @@ -79,6 +109,11 @@ Clang error for integer overflow. (Dominique Pelle, 2013 Sep 21) Patch to add v:hlsearch. (ZyX, 2013 Sep 22) +Patch to fix E315 error. (Lech Lorens, 2013 Oct 26) + +Patch to add :keeppatterns, don't put used search patterns in history. +(Christian Brabandt, 2013 Oct 18) + Problem with 'spellsuggest' file, only works for some words. (Cesar Romani, 2013 Aug 20) Depends on file name? (Aug 24) Additional remark by glts: the suggested words are marked bad? @@ -87,6 +122,11 @@ Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) +Issue 174: Detect Mason files. + +Patch for Python: Fix interrupt not being properly discarded in VimTryEnd. +With tests. (ZyX, 2013 Oct 19) Reported by Yggdroot Chen. + Patch to make has() check for Vim version and patch at the same time. (Marc Weber, 2013 Jun 7) @@ -96,9 +136,28 @@ Sep 28) With test Sept 29. VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow instead. (Samuel Ferencik, 2013 Sep 28) +Series of patches for NL vs NUL handling. (ZyX, 2013 Nov 3) + +Perl: support for Activestate perl 5.18: Issue 170. + +Bug: Does not skip over expression with dict member properly. (ZyX, 2013 Sep +29) +Patch to fix expr7() when skipping. (2013 Oct 15) Oct 23 with test. + Several syntax file match "^\s*" which may get underlined if that's in the highlight group. Add a "\zs" after it? +- Have an option for spell checking to not mark any Chinese, Japanese or + other double-width characters (or CJK characters) as error. + Helps a lot for mixed Asian and latin text. + More general: Have some way not to give spelling errors for a range of + characters. +Patch to add "cjk" to 'spelllang'. (Ken Takata, 2013 Oct 8, second one) + +Patch to add mch_copy_sec() to vim_rename(). +bug report on redhat. (Peter Backes, 2013 oct 8) +Patch to vim-dev, 2013 Oct 9. + Win32: When a directory name contains an exclamation mark, completion doesn't complete the contents of the directory. No escaping for the "!"? (Jan Stocker, 2012 Jan 5; 2013 Aug 20) @@ -106,8 +165,9 @@ Patch 2013 Sept 10, test: Sept 11. Go through more coverity reports. -Bug: Does not skip over expression with dict member properly. (ZyX, 2013 Sep -29) +Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24) + +Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16) Patch to make ColorScheme autocommand match with the colorscheme name instead of the buffer name. (Christian Brabandt, 2013 Sep 25) @@ -123,6 +183,12 @@ Patch by Christian Brabandt (2013 Aug 12) Several Win32 functions are not using Unicode. Patches to fix this. (Ken Takata, 2013 Aug 9) +Patch to add item in 'listchars' to repeat first character. (Nathaniel Braun, +pragm, 2013 Oct 13) + +Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct +3. Doesn't work properly according to Yukihiro Nakadaira. + /[b-a] gives error E16, should probably be E769. :help gives example for z?, but it does not work. m? and t? do work. @@ -210,10 +276,6 @@ Second one. Update May 22. Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec) -TCL: With MSVC 2010 doesn't find Tcl_FindExecutable. (tux) -Patch to define it. (Ken Takata, 2013 Aug 12) Is this right? -Probably not: http://code.google.com/p/vim/issues/detail?id=167 - MS-Windows: Patch to make tests copy files to avoid changing the fileformat of the files under version control. (Taro Muraoka, 2013 Jul 5) @@ -345,10 +407,6 @@ But use "gi" instead of "a". Or use CTRL-\ CTRL-O. Patch to support user name completion on MS-Windows. (Yasuhiro Matsumoto, 2012 Aug 16) -Have an option for spell checking to not mark any Chinese, Japanese or other -double-width characters as error. Or perhaps all characters above 256. -(Bill Sun) Helps a lot for mixed Asian and latin text. - When there are no command line arguments ":next" and ":argu" give E163, which is confusing. Should say "the argument list is empty". @@ -729,10 +787,6 @@ Requires a map mode for Insert mode started from blockwise Visual mode. Writing nested List and Dict in viminfo gives error message and can't be read back. (Yukihiro Nakadaira, 2010 Nov 13) -Can 'undolevels' be a buffer-local option? Helps for making big changes in -one file only, set 'ul' to -1 only for that buffer. -Patch by Christian Brabandt, 2010 Dec 17. Needs test. - Problem with cursor in the wrong column. (SungHyun Nam, 2010 Mar 11) Additional info by Dominique Pelle. (also on 2010 Apr 10) @@ -1027,7 +1081,7 @@ probably causes this. 2009 Jan 16) Patch to support strikethrough next to bold and italic. (Christian Brabandt, -2013 Jul 30) +2013 Jul 30) Update from Ken Takata, 2013 Oct 12. Document that default font in Athena can be set with resources: XtDefaultFont: "9x15" @@ -2830,10 +2884,6 @@ Tab pages: Spell checking: -- have some way not to give spelling errors for a range of characters. - E.g. for Chinese and other languages with specific characters for which we - don't have a spell file. Useful when there is also text in other - languages in the file. - Support more regions? Caolan McNamara argues it's needed for es_XX. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=219777 - Unicode defines another quote character: 0x2019. Use it as an equivalent @@ -4947,6 +4997,7 @@ Various improvements: 6 Add ":timer" command, to set a command to be executed at a certain interval, or once after some time has elapsed. (Aaron) Perhaps an autocommand event like CursorHold is better? + Patch to add async functionality. (Geoff Greer, 2013 Sep 1 and later) 8 Add ":confirm" handling in open_exfile(), for when file already exists. 8 When quitting with changed files, make the dialog list the changed file and allow "write all", "discard all", "write some". The last one would diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index cabf5f7e95..969317c2b3 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -1,4 +1,4 @@ -*visual.txt* For Vim version 7.4. Last change: 2012 Aug 15 +*visual.txt* For Vim version 7.4. Last change: 2013 Nov 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -75,7 +75,11 @@ position. *V* *linewise-visual* [count]V Start Visual mode linewise. - With [count] select that many lines. + With [count] select the same number of lines as used + for the last Visual operation, but at the current + cursor position, multiplied by [count]. When there + was no previous Visual operation [count] lines are + selected. *CTRL-V* *blockwise-visual* [count]CTRL-V Start Visual mode blockwise. Note: Under Windows diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 26629bdb73..f5ece17287 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2013 Sep 22 +" Last Change: 2013 Oct 06 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -2061,14 +2061,15 @@ au BufNewFile,BufRead */etc/sudoers,sudoers.tmp setf sudoers " SVG (Scalable Vector Graphics) au BufNewFile,BufRead *.svg setf svg -" If the file has an extension of 't' and is in a directory 't' then it is -" almost certainly a Perl test file. +" If the file has an extension of 't' and is in a directory 't' or 'xt' then +" it is almost certainly a Perl test file. " If the first line starts with '#' and contains 'perl' it's probably a Perl " file. " (Slow test) If a file contains a 'use' statement then it is almost certainly " a Perl file. func! s:FTperl() - if expand("%:e") == 't' && expand("%:p:h:t") == 't' + let dirname = expand("%:p:h:t") + if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt') setf perl return 1 endif diff --git a/runtime/ftplugin/j.vim b/runtime/ftplugin/j.vim index 8e3bc67edc..4680e7e35c 100644 --- a/runtime/ftplugin/j.vim +++ b/runtime/ftplugin/j.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: J " Maintainer: David Bürgin <676c7473@gmail.com> -" Last Change: 2013-09-21 +" Last Change: 2013-10-06 if exists("b:did_ftplugin") finish @@ -11,7 +11,8 @@ let b:did_ftplugin = 1 setlocal iskeyword=48-57,65-90,_,97-122 setlocal comments=:NB. setlocal commentstring=NB.\ %s -setlocal formatoptions-=t formatoptions+=croql +setlocal formatoptions-=t setlocal shiftwidth=2 softtabstop=2 expandtab +setlocal matchpairs=(:) -let b:undo_ftplugin = "setl et< sts< sw< fo< cms< com< isk<" +let b:undo_ftplugin = "setl mps< et< sts< sw< fo< cms< com< isk<" diff --git a/runtime/ftplugin/lisp.vim b/runtime/ftplugin/lisp.vim index 8bf6ae411c..130f30b146 100644 --- a/runtime/ftplugin/lisp.vim +++ b/runtime/ftplugin/lisp.vim @@ -4,7 +4,7 @@ " URL: http://sites.google.com/site/khorser/opensource/vim " Original author: Dorai Sitaram " Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html -" Last Change: Feb 12, 2013 +" Last Change: Oct 23, 2013 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -21,9 +21,6 @@ setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl lisp setl commentstring=;%s -" make comments behaviour like in c.vim -" e.g. insertion of ;;; and ;; on normal "O" or "o" when staying in comment setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|# -setl formatoptions+=croql let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<" diff --git a/runtime/ftplugin/scheme.vim b/runtime/ftplugin/scheme.vim index 7f3f63720d..ab1543a5ee 100644 --- a/runtime/ftplugin/scheme.vim +++ b/runtime/ftplugin/scheme.vim @@ -4,7 +4,7 @@ " URL: http://sites.google.com/site/khorser/opensource/vim " Original author: Dorai Sitaram " Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html -" Last Change: Feb 12, 2013 +" Last Change: Oct 23, 2013 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -22,10 +22,7 @@ setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl lisp setl commentstring=;%s -" make comments behaviour like in c.vim -" e.g. insertion of ;;; and ;; on normal "O" or "o" when staying in comment setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|# -setl formatoptions+=croql " Scheme-specific settings if exists("b:is_mzscheme") || exists("is_mzscheme") diff --git a/runtime/syntax/clean.vim b/runtime/syntax/clean.vim index 11aa028b71..ea95aa209e 100644 --- a/runtime/syntax/clean.vim +++ b/runtime/syntax/clean.vim @@ -2,7 +2,7 @@ " Language: Clean " Author: Pieter van Engelen " Co-Author: Arthur van Leeuwen -" Last Change: 2013 Jun 19 by Jurriën Stutterheim +" Last Change: 2013 Oct 15 by Jurriën Stutterheim " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -31,11 +31,10 @@ syn keyword cleanIncludeKeyword contained from import as qualified " To do some Denotation Highlighting syn keyword cleanBoolDenot True False -syn region cleanStringDenot start=+"+ end=+"+ -syn match cleanCharDenot "'.'" -syn match cleanCharsDenot "'[^'\\]*\(\\.[^'\\]\)*'" contained -syn match cleanIntegerDenot "[+-~]\=\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>" -syn match cleanRealDenot "[+-~]\=\<\d\+\.\d+\(E[+-~]\=\d+\)\=" +syn region cleanStringDenot start=+"+ skip=+\(\(\\\\\)\+\|\\"\)+ end=+"+ display +syn match cleanCharDenot "'\(\\\\\|\\'\|[^'\\]\)\+'" display +syn match cleanIntegerDenot "[\~+-]\?\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>" display +syn match cleanRealDenot "[\~+-]\?\d\+\.\d\+\(E[\~+-]\?\d\+\)\?" display " To highlight the use of lists, tuples and arrays syn region cleanList start="\[" end="\]" contains=ALL @@ -44,11 +43,13 @@ syn region cleanArray start="{:" end=":}" contains=ALL syn match cleanTuple "([^=]*,[^=]*)" contains=ALL " To do some Comment Highlighting -syn region cleanComment start="/\*" end="\*/" contains=cleanComment -syn match cleanComment "//.*" +syn region cleanComment start="/\*" end="\*/" contains=cleanComment,cleanTodo fold +syn region cleanComment start="//.*" end="$" display contains=cleanTodo +syn keyword cleanTodo TODO FIXME XXX contained + +" Now for some useful type definition recognition +syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)\s*\(infix[lr]\=\)\=\s*\d\=\s*::.*->.*" contains=cleanSpecial,cleanBasicType,cleanSpecialType,cleanKeyword -" Now for some useful typedefinitionrecognition -syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)[ \t]*\(infix[lr]\=\)\=[ \t]*\d\=[ \t]*::.*->.*" contains=cleanSpecial " Define the default highlighting. " For version 5.7 and earlier: only when not done already @@ -64,7 +65,6 @@ if version >= 508 || !exists("did_clean_syntax_init") " Comments HiLink cleanComment Comment " Constants and denotations - HiLink cleanCharsDenot String HiLink cleanStringDenot String HiLink cleanCharDenot Character HiLink cleanIntegerDenot Number @@ -91,6 +91,7 @@ if version >= 508 || !exists("did_clean_syntax_init") HiLink cleanTuple Special " Error " Todo + HiLink cleanTodo Todo delcommand HiLink endif diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim index 484e2cca65..aa5be3f6fe 100644 --- a/runtime/syntax/diff.vim +++ b/runtime/syntax/diff.vim @@ -2,7 +2,7 @@ " Language: Diff (context or unified) " Maintainer: Bram Moolenaar " Translations by Jakson Alves de Aquino. -" Last Change: 2013 Jul 24 +" Last Change: 2013 Oct 06 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -336,7 +336,7 @@ syn match diffLine "^---$" "Some versions of diff have lines like "#c#" and "#d#" (where # is a number) syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*" -syn match diffFile "^diff.*" +syn match diffFile "^diff\>.*" syn match diffFile "^+++ .*" syn match diffFile "^Index: .*" syn match diffFile "^==== .*" diff --git a/runtime/syntax/dnsmasq.vim b/runtime/syntax/dnsmasq.vim index ebee808a57..7ef767d398 100644 --- a/runtime/syntax/dnsmasq.vim +++ b/runtime/syntax/dnsmasq.vim @@ -1,26 +1,19 @@ " Vim syntax file " Maintainer: Thilo Six -" Contact: -" http://www.vim.org/maillist.php#vim-dev -" +" Contact: vim-foo@xk2c-foo.de +" :3s+-foo++g " Description: highlight dnsmasq configuration files " File: runtime/syntax/dnsmasq.vim -" Version: 2.61-1 -" Last Change: 2012 May 19 +" Version: 2.67 +" Last Change: 2013 Nov 03 " Modeline: vim: ts=8:sw=2:sts=2: " -" Credits: Igor N. Prischepoff -" Doug Kearns -" David Ne\v{c}as -" Christian Brabandt -" " License: VIM License " Vim is Charityware, see ":help Uganda" " " Options: You might want to add this to your vimrc: " " if &background == "dark" -" " dnsmasq.vim " let dnsmasq_backrgound_light = 0 " else " let dnsmasq_backrgound_light = 1 @@ -28,8 +21,7 @@ " " For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 +if v:version < 600 syntax clear elseif exists("b:current_syntax") || &compatible finish @@ -39,11 +31,11 @@ let s:cpo_save = &cpo set cpo&vim if !exists("b:dnsmasq_backrgound_light") - if exists("dnsmasq_backrgound_light") - let b:dnsmasq_backrgound_light = dnsmasq_backrgound_light - else - let b:dnsmasq_backrgound_light = 0 - endif + if exists("dnsmasq_backrgound_light") + let b:dnsmasq_backrgound_light = dnsmasq_backrgound_light + else + let b:dnsmasq_backrgound_light = 0 + endif endif @@ -89,10 +81,13 @@ syn match DnsmasqKeywordSpecial ",\"hs=s+1 contains=DnsmasqSpecial syn match DnsmasqKeywordSpecial "\:"me=e-1 syn match DnsmasqKeyword "^\s*add-mac\>" +syn match DnsmasqKeyword "^\s*add-subnet\>" syn match DnsmasqKeyword "^\s*addn-hosts\>" syn match DnsmasqKeyword "^\s*address\>" syn match DnsmasqKeyword "^\s*alias\>" syn match DnsmasqKeyword "^\s*all-servers\>" +syn match DnsmasqKeyword "^\s*auth-zone\>" +syn match DnsmasqKeyword "^\s*bind-dynamic\>" syn match DnsmasqKeyword "^\s*bind-interfaces\>" syn match DnsmasqKeyword "^\s*bogus-nxdomain\>" syn match DnsmasqKeyword "^\s*bogus-priv\>" @@ -128,6 +123,7 @@ syn match DnsmasqKeyword "^\s*dhcp-option-force\>" syn match DnsmasqKeyword "^\s*dhcp-optsfile\>" syn match DnsmasqKeyword "^\s*dhcp-proxy\>" syn match DnsmasqKeyword "^\s*dhcp-range\>" +syn match DnsmasqKeyword "^\s*dhcp-relay\>" syn match DnsmasqKeyword "^\s*dhcp-remoteid\>" syn match DnsmasqKeyword "^\s*dhcp-script\>" syn match DnsmasqKeyword "^\s*dhcp-scriptuser\>" @@ -135,6 +131,7 @@ syn match DnsmasqKeyword "^\s*dhcp-sequential-ip\>" syn match DnsmasqKeyword "^\s*dhcp-subscrid\>" syn match DnsmasqKeyword "^\s*dhcp-userclass\>" syn match DnsmasqKeyword "^\s*dhcp-vendorclass\>" +syn match DnsmasqKeyword "^\s*dns-rr\>" syn match DnsmasqKeyword "^\s*dns-forward-max\>" syn match DnsmasqKeyword "^\s*domain\>" syn match DnsmasqKeyword "^\s*domain-needed\>" @@ -149,6 +146,7 @@ syn match DnsmasqKeyword "^\s*group\>" syn match DnsmasqKeyword "^\s*host-record\>" syn match DnsmasqKeyword "^\s*interface\>" syn match DnsmasqKeyword "^\s*interface-name\>" +syn match DnsmasqKeyword "^\s*ipset\>" syn match DnsmasqKeyword "^\s*keep-in-foreground\>" syn match DnsmasqKeyword "^\s*leasefile-ro\>" syn match DnsmasqKeyword "^\s*listen-address\>" @@ -161,6 +159,7 @@ syn match DnsmasqKeyword "^\s*log-dhcp\>" syn match DnsmasqKeyword "^\s*log-facility\>" syn match DnsmasqKeyword "^\s*log-queries\>" syn match DnsmasqKeyword "^\s*max-ttl\>" +syn match DnsmasqKeyword "^\s*max-cache-ttl\>" syn match DnsmasqKeyword "^\s*min-port\>" syn match DnsmasqKeyword "^\s*mx-host\>" syn match DnsmasqKeyword "^\s*mx-target\>" @@ -180,6 +179,10 @@ syn match DnsmasqKeyword "^\s*ptr-record\>" syn match DnsmasqKeyword "^\s*pxe-prompt\>" syn match DnsmasqKeyword "^\s*pxe-service\>" syn match DnsmasqKeyword "^\s*query-port\>" +syn match DnsmasqKeyword "^\s*quiet-ra\>" +syn match DnsmasqKeyword "^\s*quiet-dhcp\>" +syn match DnsmasqKeyword "^\s*quiet-dhcp6\>" +syn match DnsmasqKeyword "^\s*ra-param\>" syn match DnsmasqKeyword "^\s*read-ethers\>" syn match DnsmasqKeyword "^\s*rebind-domain-ok\>" syn match DnsmasqKeyword "^\s*rebind-localhost-ok\>" @@ -189,6 +192,7 @@ syn match DnsmasqKeyword "^\s*server\>" syn match DnsmasqKeyword "^\s*srv-host\>" syn match DnsmasqKeyword "^\s*stop-dns-rebind\>" syn match DnsmasqKeyword "^\s*strict-order\>" +syn match DnsmasqKeyword "^\s*synth-domain\>" syn match DnsmasqKeyword "^\s*tag-if\>" syn match DnsmasqKeyword "^\s*test\>" syn match DnsmasqKeyword "^\s*tftp-max\>" diff --git a/runtime/syntax/dts.vim b/runtime/syntax/dts.vim index d7663cf72a..cd4bd776b7 100644 --- a/runtime/syntax/dts.vim +++ b/runtime/syntax/dts.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: dts/dtsi (device tree files) " Maintainer: Daniel Mack -" Last Change: 2013 Apr 05 +" Last Change: 2013 Oct 20 if exists("b:current_syntax") finish @@ -11,11 +11,12 @@ syntax region dtsComment start="/\*" end="\*/" syntax match dtsReference "&[[:alpha:][:digit:]_]\+" syntax region dtsBinaryProperty start="\[" end="\]" syntax match dtsStringProperty "\".*\"" -syntax match dtsKeyword "/.*/" +syntax match dtsKeyword "/.\{-1,\}/" syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:" syntax match dtsNode /[[:alpha:][:digit:]-_]\+\(@[0-9a-fA-F]\+\|\)[[:space:]]*{/he=e-1 syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinaryProperty,dtsStringProperty,dtsComment syntax region dtsCommentInner start="/\*" end="\*/" +syntax match dtsCommentLine "//.*$" hi def link dtsCellProperty Number hi def link dtsBinaryProperty Number @@ -26,3 +27,4 @@ hi def link dtsNode Structure hi def link dtsReference Macro hi def link dtsComment Comment hi def link dtsCommentInner Comment +hi def link dtsCommentLine Comment diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim index 6ba9366a41..368cfc6cd5 100644 --- a/runtime/syntax/j.vim +++ b/runtime/syntax/j.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: J " Maintainer: David Bürgin <676c7473@gmail.com> -" Last Change: 2013-09-21 +" Last Change: 2013-10-06 if exists("b:current_syntax") finish @@ -33,11 +33,13 @@ syn match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+/ syn match jNumber /\<__\=\>/ syn match jNumber /\<_\=\d\+x\>/ -syn match jComment /NB\..*$/ +syn match jComment /NB\..*$/ contains=jTodo,@Spell +syn keyword jTodo TODO FIXME XXX contained hi def link jControl Statement hi def link jString String hi def link jNumber Number hi def link jComment Comment +hi def link jTodo Todo let b:current_syntax = "j" diff --git a/runtime/syntax/upstreamlog.vim b/runtime/syntax/upstreamlog.vim index 1161ecfcbe..1439bdffe6 100644 --- a/runtime/syntax/upstreamlog.vim +++ b/runtime/syntax/upstreamlog.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Innovation Data Processing upstream.log file " Maintainer: Rob Owens -" Latest Revision: 2013-07-26 +" Latest Revision: 2013-09-19 " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -31,13 +31,14 @@ syn match upstreamlog_Profile / Profile: \zs\S\{1,8}/ syn match upstreamlog_Profile / Profile: \zs\S\{1,8}\ze, / syn match upstreamlog_Profile /, profile: \zs\S\{1,8}\ze,/ syn match upstreamlog_Profile /found Profile: \zs\S\{1,8}\ze,/ -syn match upstreamlog_Profile /Backup Profile: \zs\ze Version date/ +syn match upstreamlog_Profile /Backup Profile: \zs\S\{1,8}\ze Version date/ +syn match upstreamlog_Profile /Backup profile: \zs\S\{1,8}\ze Version date/ syn match upstreamlog_Profile /Full of \zs\S\{1,8}\ze$/ syn match upstreamlog_Profile /Incr. of \zs\S\{1,8}\ze$/ syn match upstreamlog_Profile /Profile=\zs\S\{1,8}\ze,/ " Target: syn region upstreamlog_Target start="Computer: \zs" end="\ze[\]\)]" -syn region upstreamlog_Target start="Computer name \zs" end="\ze," +syn region upstreamlog_Target start="Computer name \zs\"" end="\"\ze" syn region upstreamlog_Target start="request to registered name \zs" end=" " diff --git a/runtime/syntax/usserverlog.vim b/runtime/syntax/usserverlog.vim index 7cd50b3287..34a7e3dca0 100644 --- a/runtime/syntax/usserverlog.vim +++ b/runtime/syntax/usserverlog.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Innovation Data Processing usserver.log file " Maintainer: Rob Owens -" Latest Revision: 2013-07-26 +" Latest Revision: 2013-09-19 " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -36,13 +36,14 @@ syn match usserverlog_Profile /, profile: \zs\S\{1,8}\ze,/ syn match usserverlog_Profile /Expecting Profile: \zs\S\{1,8}\ze,/ syn match usserverlog_Profile /found Profile: \zs\S\{1,8}\ze,/ syn match usserverlog_Profile /Profile \zs\S\{1,8} \zeis a member of group: / -syn match usserverlog_Profile /Backup Profile: \zs\ze Version date/ +syn match upstreamlog_Profile /Backup Profile: \zs\S\{1,8}\ze Version date/ +syn match upstreamlog_Profile /Backup profile: \zs\S\{1,8}\ze Version date/ syn match usserverlog_Profile /Full of \zs\S\{1,8}\ze$/ syn match usserverlog_Profile /Incr. of \zs\S\{1,8}\ze$/ syn match usserverlog_Profile /Profile=\zs\S\{1,8}\ze,/ " Target: syn region usserverlog_Target start="Computer: \zs" end="\ze[\]\)]" -syn region usserverlog_Target start="Computer name \zs" end="\ze," +syn region usserverlog_Target start="Computer name \zs\"" end="\"\ze" syn region usserverlog_Target start="Registration add request successful \zs" end="$" syn region usserverlog_Target start="request to registered name \zs" end=" " syn region usserverlog_Target start=", sending to \zs" end="$" diff --git a/runtime/syntax/usw2kagtlog.vim b/runtime/syntax/usw2kagtlog.vim index 9315731343..0a34128f9b 100644 --- a/runtime/syntax/usw2kagtlog.vim +++ b/runtime/syntax/usw2kagtlog.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Innovation Data Processing USW2KAgt.log file " Maintainer: Rob Owens -" Latest Revision: 2013-07-26 +" Latest Revision: 2013-09-19 " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -26,13 +26,14 @@ syn match usw2kagtlog_IPaddr / \d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ syn match usw2kagtlog_Profile /Profile name \zs\"\S\{1,8}\"/ syn match usw2kagtlog_Profile / Profile: \zs\S\{1,8}/ syn match usw2kagtlog_Profile / Profile: \zs\S\{1,8}\ze, / -syn match usw2kagtlog_Profile /Backup Profile: \zs\ze Version date/ +syn match upstreamlog_Profile /Backup Profile: \zs\S\{1,8}\ze Version date/ +syn match upstreamlog_Profile /Backup profile: \zs\S\{1,8}\ze Version date/ syn match usw2kagtlog_Profile /Full of \zs\S\{1,8}\ze$/ syn match usw2kagtlog_Profile /Incr. of \zs\S\{1,8}\ze$/ syn match usw2kagtlog_Profile /profile name "\zs\S\{1,8}\ze"/ " Target: syn region usw2kagtlog_Target start="Computer: \zs" end="\ze[\]\)]" -syn region usw2kagtlog_Target start="Computer name \zs" end="\ze," +syn region usw2kagtlog_Target start="Computer name \zs\"" end="\"\ze" " Agent Keywords: syn keyword usw2kagtlog_Agentword opened closed diff --git a/runtime/vimlogo.eps b/runtime/vimlogo.eps index 5bf45ff4f7..3b567b0a7d 100644 --- a/runtime/vimlogo.eps +++ b/runtime/vimlogo.eps @@ -1,791 +1,803 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%BoundingBox: 147 74 429 356 -%%LanguageLevel: 1 -%%Creator: CorelDRAW 11 -%%Title: vimlogo.eps -%%CreationDate: Mon Feb 02 14:35:16 2004 -%%DocumentProcessColors: Cyan Yellow Black -%%DocumentSuppliedResources: (atend) -%%EndComments -%%BeginProlog -/AutoFlatness false def -/AutoSteps 0 def -/CMYKMarks true def -/UseLevel 1 def -%Build: CorelDRAW 11 Version 11.633 -%Color profile: Generic offset separations profile -/CorelIsEPS true def -%%BeginResource: procset wCorel11Dict 11.0 0 -/wCorel11Dict 300 dict def wCorel11Dict begin -% Copyright (c)1992-2002 Corel Corporation -% All rights reserved. v11.0 r0.0 -/bd{bind def}bind def/ld{load def}bd/xd{exch def}bd/_ null def/rp{{pop}repeat} -bd/@cp/closepath ld/@gs/gsave ld/@gr/grestore ld/@np/newpath ld/Tl/translate ld -/$sv 0 def/@sv{/$sv save def}bd/@rs{$sv restore}bd/spg/showpage ld/showpage{} -bd currentscreen/@dsp xd/$dsp/@dsp def/$dsa xd/$dsf xd/$sdf false def/$SDF -false def/$Scra 0 def/SetScr/setscreen ld/@ss{2 index 0 eq{$dsf 3 1 roll 4 -1 -roll pop}if exch $Scra add exch load SetScr}bd/SepMode_5 where{pop}{/SepMode_5 -0 def}ifelse/CorelIsSeps where{pop}{/CorelIsSeps false def}ifelse -/CorelIsInRIPSeps where{pop}{/CorelIsInRIPSeps false def}ifelse/CorelIsEPS -where{pop}{/CorelIsEPS false def}ifelse/CurrentInkName_5 where{pop} -{/CurrentInkName_5(Composite)def}ifelse/$ink_5 where{pop}{/$ink_5 -1 def} -ifelse/$c 0 def/$m 0 def/$y 0 def/$k 0 def/$t 1 def/$n _ def/$o 0 def/$fil 0 -def/$C 0 def/$M 0 def/$Y 0 def/$K 0 def/$T 1 def/$N _ def/$O 0 def/$PF false -def/s1c 0 def/s1m 0 def/s1y 0 def/s1k 0 def/s1t 0 def/s1n _ def/$bkg false def -/SK 0 def/SM 0 def/SY 0 def/SC 0 def/$op false def matrix currentmatrix/$ctm xd -/$ptm matrix def/$ttm matrix def/$stm matrix def/$ffpnt true def -/CorelDrawReencodeVect[16#0/grave 16#5/breve 16#6/dotaccent 16#8/ring -16#A/hungarumlaut 16#B/ogonek 16#C/caron 16#D/dotlessi 16#27/quotesingle -16#60/grave 16#7C/bar -16#82/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl -16#88/circumflex/perthousand/Scaron/guilsinglleft/OE -16#91/quoteleft/quoteright/quotedblleft/quotedblright/bullet/endash/emdash -16#98/tilde/trademark/scaron/guilsinglright/oe 16#9F/Ydieresis -16#A1/exclamdown/cent/sterling/currency/yen/brokenbar/section -16#a8/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/minus/registered/macron -16#b0/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered -16#b8/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown -16#c0/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla -16#c8/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis -16#d0/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply -16#d8/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls -16#e0/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla -16#e8/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis -16#f0/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide -16#f8/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def -/L2?/languagelevel where{pop languagelevel 2 ge}{false}ifelse def/Comp?{ -/LumSepsDict where{pop false}{/AldusSepsDict where{pop false}{1 0 0 0 @gs -setcmykcolor currentcmykcolor @gr add add add 0 ne 0 1 0 0 @gs setcmykcolor -currentcmykcolor @gr add add add 0 ne 0 0 1 0 @gs setcmykcolor currentcmykcolor -@gr add add add 0 ne 0 0 0 1 @gs setcmykcolor currentcmykcolor @gr add add add -0 ne and and and}ifelse}ifelse}bd/@PL{/LV where{pop LV 2 ge L2? not and{@np -/Courier findfont 12 scalefont setfont 72 144 m -(The PostScript level set in the Corel application is higher than)show 72 132 m -(the PostScript level of this device. Change the PS Level in the Corel)show 72 -120 m(application to Level 1 by selecting the PostScript tab in the print)show -72 108 m(dialog, and selecting Level 1 from the Compatibility drop down list.) -show flush spg quit}if}if}bd/@BeginSysCorelDict{systemdict/Corel30Dict known -{systemdict/Corel30Dict get exec}if systemdict/CorelLexDict known{1 systemdict -/CorelLexDict get exec}if}bd/@EndSysCorelDict{systemdict/Corel30Dict known -{end}if/EndCorelLexDict where{pop EndCorelLexDict}if}bd AutoFlatness{/@ifl{dup -currentflat exch sub 10 gt{ -([Error: PathTooComplex; OffendingCommand: AnyPaintingOperator]\n)print flush -@np exit}{currentflat 2 add setflat}ifelse}bd/@fill/fill ld/fill{currentflat{ -{@fill}stopped{@ifl}{exit}ifelse}bind loop setflat}bd/@eofill/eofill ld/eofill -{currentflat{{@eofill}stopped{@ifl}{exit}ifelse}bind loop setflat}bd/@clip -/clip ld/clip{currentflat{{@clip}stopped{@ifl}{exit}ifelse}bind loop setflat} -bd/@eoclip/eoclip ld/eoclip{currentflat{{@eoclip}stopped{@ifl}{exit}ifelse} -bind loop setflat}bd/@stroke/stroke ld/stroke{currentflat{{@stroke}stopped -{@ifl}{exit}ifelse}bind loop setflat}bd}if L2?{/@ssa{true setstrokeadjust}bd}{ -/@ssa{}bd}ifelse/d/setdash ld/j/setlinejoin ld/J/setlinecap ld/M/setmiterlimit -ld/w/setlinewidth ld/O{/$o xd}bd/R{/$O xd}bd/W/eoclip ld/c/curveto ld/C/c ld/l -/lineto ld/L/l ld/rl/rlineto ld/m/moveto ld/n/newpath ld/N/newpath ld/P{11 rp} -bd/u{}bd/U{}bd/A{pop}bd/q/@gs ld/Q/@gr ld/&{}bd/@j{@sv @np}bd/@J{@rs}bd/g{1 -exch sub/$k xd/$c 0 def/$m 0 def/$y 0 def/$t 1 def/$n _ def/$fil 0 def}bd/G{1 -sub neg/$K xd _ 1 0 0 0/$C xd/$M xd/$Y xd/$T xd/$N xd}bd/k{1 index type -/stringtype eq{/$t xd/$n xd}{/$t 0 def/$n _ def}ifelse/$k xd/$y xd/$m xd/$c xd -/$fil 0 def}bd/K{1 index type/stringtype eq{/$T xd/$N xd}{/$T 0 def/$N _ def} -ifelse/$K xd/$Y xd/$M xd/$C xd}bd/x/k ld/X/K ld/sf{1 index type/stringtype eq{ -/s1t xd/s1n xd}{/s1t 0 def/s1n _ def}ifelse/s1k xd/s1y xd/s1m xd/s1c xd}bd/i{ -dup 0 ne{setflat}{pop}ifelse}bd/v{4 -2 roll 2 copy 6 -2 roll c}bd/V/v ld/y{2 -copy c}bd/Y/y ld/@w{matrix rotate/$ptm xd matrix scale $ptm dup concatmatrix -/$ptm xd 1 eq{$ptm exch dup concatmatrix/$ptm xd}if 1 w}bd/@g{1 eq dup/$sdf xd -{/$scp xd/$sca xd/$scf xd}if}bd/@G{1 eq dup/$SDF xd{/$SCP xd/$SCA xd/$SCF xd} -if}bd/@D{2 index 0 eq{$dsf 3 1 roll 4 -1 roll pop}if 3 copy exch $Scra add exch -load SetScr/$dsp xd/$dsa xd/$dsf xd}bd/$ngx{$SDF{$SCF SepMode_5 0 eq{$SCA} -{$dsa}ifelse $SCP @ss}if}bd/@MN{2 copy le{pop}{exch pop}ifelse}bd/@MX{2 copy ge -{pop}{exch pop}ifelse}bd/InRange{3 -1 roll @MN @MX}bd/@sqr{dup 0 rl dup 0 exch -rl neg 0 rl @cp}bd/currentscale{1 0 dtransform matrix defaultmatrix idtransform -dup mul exch dup mul add sqrt 0 1 dtransform matrix defaultmatrix idtransform -dup mul exch dup mul add sqrt}bd/@unscale{}bd/wDstChck{2 1 roll dup 3 -1 roll -eq{1 add}if}bd/@dot{dup mul exch dup mul add 1 exch sub}bd/@lin{exch pop abs 1 -exch sub}bd/cmyk2rgb{3{dup 5 -1 roll add 1 exch sub dup 0 lt{pop 0}if exch} -repeat pop}bd/rgb2cmyk{3{1 exch sub 3 1 roll}repeat 3 copy @MN @MN 3{dup 5 -1 -roll sub neg exch}repeat}bd/rgb2g{2 index .299 mul 2 index .587 mul add 1 index -.114 mul add 4 1 roll pop pop pop}bd/WaldoColor_5 where{pop}{/SetRgb -/setrgbcolor ld/GetRgb/currentrgbcolor ld/SetGry/setgray ld/GetGry/currentgray -ld/SetRgb2 systemdict/setrgbcolor get def/GetRgb2 systemdict/currentrgbcolor -get def/SetHsb systemdict/sethsbcolor get def/GetHsb systemdict -/currenthsbcolor get def/rgb2hsb{SetRgb2 GetHsb}bd/hsb2rgb{3 -1 roll dup floor -sub 3 1 roll SetHsb GetRgb2}bd/setcmykcolor where{pop/LumSepsDict where{pop -/SetCmyk_5{LumSepsDict/setcmykcolor get exec}def}{/AldusSepsDict where{pop -/SetCmyk_5{AldusSepsDict/setcmykcolor get exec}def}{/SetCmyk_5/setcmykcolor ld -}ifelse}ifelse}{/SetCmyk_5{cmyk2rgb SetRgb}bd}ifelse/currentcmykcolor where{ -pop/GetCmyk/currentcmykcolor ld}{/GetCmyk{GetRgb rgb2cmyk}bd}ifelse -/setoverprint where{pop}{/setoverprint{/$op xd}bd}ifelse/currentoverprint where -{pop}{/currentoverprint{$op}bd}ifelse/@tc_5{5 -1 roll dup 1 ge{pop}{4{dup 6 -1 -roll mul exch}repeat pop}ifelse}bd/@trp{exch pop 5 1 roll @tc_5}bd -/setprocesscolor_5{SepMode_5 0 eq{SetCmyk_5}{0 4 $ink_5 sub index exch pop 5 1 -roll pop pop pop pop SepsColor true eq{$ink_5 3 gt{1 sub neg SetGry}{0 0 0 4 -$ink_5 roll SetCmyk_5}ifelse}{1 sub neg SetGry}ifelse}ifelse}bd -/findcmykcustomcolor where{pop}{/findcmykcustomcolor{5 array astore}bd}ifelse -/Corelsetcustomcolor_exists false def/setcustomcolor where{pop -/Corelsetcustomcolor_exists true def}if CorelIsSeps true eq CorelIsInRIPSeps -false eq and{/Corelsetcustomcolor_exists false def}if -Corelsetcustomcolor_exists false eq{/setcustomcolor{exch aload pop SepMode_5 0 -eq{pop @tc_5 setprocesscolor_5}{CurrentInkName_5 eq{4 index}{0}ifelse 6 1 roll -5 rp 1 sub neg SetGry}ifelse}bd}if/@scc_5{dup type/booleantype eq{dup -currentoverprint ne{setoverprint}{pop}ifelse}{1 eq setoverprint}ifelse dup _ eq -{pop setprocesscolor_5 pop}{findcmykcustomcolor exch setcustomcolor}ifelse -SepMode_5 0 eq{true}{GetGry 1 eq currentoverprint and not}ifelse}bd/colorimage -where{pop/ColorImage{colorimage}def}{/ColorImage{/ncolors xd/$multi xd $multi -true eq{ncolors 3 eq{/daqB xd/daqG xd/daqR xd pop pop exch pop abs{daqR pop -daqG pop daqB pop}repeat}{/daqK xd/daqY xd/daqM xd/daqC xd pop pop exch pop abs -{daqC pop daqM pop daqY pop daqK pop}repeat}ifelse}{/dataaq xd{dataaq ncolors -dup 3 eq{/$dat xd 0 1 $dat length 3 div 1 sub{dup 3 mul $dat 1 index get 255 -div $dat 2 index 1 add get 255 div $dat 3 index 2 add get 255 div rgb2g 255 mul -cvi exch pop $dat 3 1 roll put}for $dat 0 $dat length 3 idiv getinterval pop}{ -4 eq{/$dat xd 0 1 $dat length 4 div 1 sub{dup 4 mul $dat 1 index get 255 div -$dat 2 index 1 add get 255 div $dat 3 index 2 add get 255 div $dat 4 index 3 -add get 255 div cmyk2rgb rgb2g 255 mul cvi exch pop $dat 3 1 roll put}for $dat -0 $dat length ncolors idiv getinterval}if}ifelse}image}ifelse}bd}ifelse -/setcmykcolor{1 5 1 roll _ currentoverprint @scc_5/$ffpnt xd}bd -/currentcmykcolor{GetCmyk}bd/setrgbcolor{rgb2cmyk setcmykcolor}bd -/currentrgbcolor{currentcmykcolor cmyk2rgb}bd/sethsbcolor{hsb2rgb setrgbcolor} -bd/currenthsbcolor{currentrgbcolor rgb2hsb}bd/setgray{dup dup setrgbcolor}bd -/currentgray{currentrgbcolor rgb2g}bd/InsideDCS false def/IMAGE/image ld/image -{InsideDCS{IMAGE}{/EPSDict where{pop SepMode_5 0 eq{IMAGE}{dup type/dicttype eq -{dup/ImageType get 1 ne{IMAGE}{dup dup/BitsPerComponent get 8 eq exch -/BitsPerComponent get 1 eq or currentcolorspace 0 get/DeviceGray eq and{ -CurrentInkName_5(Black)eq{IMAGE}{dup/DataSource get/TCC xd/Height get abs{TCC -pop}repeat}ifelse}{IMAGE}ifelse}ifelse}{2 index 1 ne{CurrentInkName_5(Black)eq -{IMAGE}{/TCC xd pop pop exch pop abs{TCC pop}repeat}ifelse}{IMAGE}ifelse} -ifelse}ifelse}{IMAGE}ifelse}ifelse}bd}ifelse/WaldoColor_5 true def/$fm 0 def -/wfill{1 $fm eq{fill}{eofill}ifelse}bd/@Pf{@sv SepMode_5 0 eq $Psc 0 ne or -$ink_5 3 eq or{0 J 0 j[]0 d $t $c $m $y $k $n $o @scc_5 pop $ctm setmatrix 72 -1000 div dup matrix scale dup concat dup Bburx exch Bbury exch itransform -ceiling cvi/Bbury xd ceiling cvi/Bburx xd Bbllx exch Bblly exch itransform -floor cvi/Bblly xd floor cvi/Bbllx xd $Prm aload pop $Psn load exec}{1 SetGry -wfill}ifelse @rs @np}bd/F{matrix currentmatrix $sdf{$scf $sca $scp @ss}if $fil -1 eq{CorelPtrnDoFill}{$fil 2 eq{@ff}{$fil 3 eq{@Pf}{$fil 4 eq -{CorelShfillDoFill}{$t $c $m $y $k $n $o @scc_5{wfill}{@np}ifelse}ifelse} -ifelse}ifelse}ifelse $sdf{$dsf $dsa $dsp @ss}if setmatrix}bd/f{@cp F}bd/S{ -matrix currentmatrix $ctm setmatrix $SDF{$SCF $SCA $SCP @ss}if $T $C $M $Y $K -$N $O @scc_5{matrix currentmatrix $ptm concat stroke setmatrix}{@np}ifelse $SDF -{$dsf $dsa $dsp @ss}if setmatrix}bd/s{@cp S}bd/B{@gs F @gr S}bd/b{@cp B}bd/_E{ -5 array astore exch cvlit xd}bd/@cc{currentfile $dat readhexstring pop}bd/@sm{ -/$ctm $ctm currentmatrix def}bd/@E{/Bbury xd/Bburx xd/Bblly xd/Bbllx xd}bd/@c{ -@cp}bd/@P{/$fil 3 def/$Psn xd/$Psc xd array astore/$Prm xd}bd/tcc{@cc}def/@B{ -@gs S @gr F}bd/@b{@cp @B}bd/@sep{CurrentInkName_5(Composite)eq{/$ink_5 -1 def} -{CurrentInkName_5(Cyan)eq{/$ink_5 0 def}{CurrentInkName_5(Magenta)eq{/$ink_5 1 -def}{CurrentInkName_5(Yellow)eq{/$ink_5 2 def}{CurrentInkName_5(Black)eq -{/$ink_5 3 def}{/$ink_5 4 def}ifelse}ifelse}ifelse}ifelse}ifelse}bd/@whi{@gs --72000 dup m -72000 72000 l 72000 dup l 72000 -72000 l @cp 1 SetGry fill @gr} -bd/@neg{[{1 exch sub}/exec cvx currenttransfer/exec cvx]cvx settransfer @whi} -bd/deflevel 0 def/@sax{/deflevel deflevel 1 add def}bd/@eax{/deflevel deflevel -dup 0 gt{1 sub}if def deflevel 0 gt{/eax load}{eax}ifelse}bd/eax{{exec}forall} -bd/@rax{deflevel 0 eq{@rs @sv}if}bd systemdict/pdfmark known not{/pdfmark -/cleartomark ld}if/wclip{1 $fm eq{clip}{eoclip}ifelse}bd -% Copyright (c)1992-2002 Corel Corporation -% All rights reserved. v11.0 r0.0 -/@ii{concat 3 index 3 index m 3 index 1 index l 2 copy l 1 index 3 index l 3 -index 3 index l clip pop pop pop pop}bd/@i{@sm @gs @ii 6 index 1 ne{/$frg true -def pop pop}{1 eq{s1t s1c s1m s1y s1k s1n $O @scc_5/$frg xd}{/$frg false def} -ifelse 1 eq{@gs $ctm setmatrix F @gr}if}ifelse @np/$ury xd/$urx xd/$lly xd -/$llx xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul 8 div ceiling cvi string -def $bkg $frg or{$SDF{$SCF $SCA $SCP @ss}if $llx $lly Tl $urx $llx sub $ury -$lly sub scale $bkg{$t $c $m $y $k $n $o @scc_5 pop}if $wid $hei abs $bts 1 eq -{$bkg}{$bts}ifelse[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]/tcc load $bts -1 eq{imagemask}{image}ifelse $SDF{$dsf $dsa $dsp @ss}if}{$hei abs{tcc pop} -repeat}ifelse @gr $ctm setmatrix}bd/@I{@sm @gs @ii @np/$ury xd/$urx xd/$lly xd -/$llx xd/$ncl xd/$bts xd/$hei xd/$wid xd $ngx $llx $lly Tl $urx $llx sub $ury -$lly sub scale $wid $hei abs $bts[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse -]$msimage false eq $ncl 1 eq or{/$dat $wid $bts mul $ncl mul 8 div ceiling cvi -string def/@cc load false $ncl ColorImage}{$wid $bts mul 8 div ceiling cvi $ncl -3 eq{dup dup/$dat1 exch string def/$dat2 exch string def/$dat3 exch string def -/@cc1 load/@cc2 load/@cc3 load}{dup dup dup/$dat1 exch string def/$dat2 exch -string def/$dat3 exch string def/$dat4 exch string def/@cc1 load/@cc2 load -/@cc3 load/@cc4 load}ifelse true $ncl ColorImage}ifelse $SDF{$dsf $dsa $dsp -@ss}if @gr $ctm setmatrix}bd/@cc1{currentfile $dat1 readhexstring pop}bd/@cc2{ -currentfile $dat2 readhexstring pop}bd/@cc3{currentfile $dat3 readhexstring pop -}bd/@cc4{currentfile $dat4 readhexstring pop}bd/$msimage false def/COMP 0 def -/MaskedImage false def L2?{/@I_2{@sm @gs @ii @np/$ury xd/$urx xd/$lly xd/$llx -xd/$ncl xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul $ncl mul 8 div ceiling -cvi string def $ngx $ncl 1 eq{/DeviceGray}{$ncl 3 eq{/DeviceRGB}{/DeviceCMYK} -ifelse}ifelse setcolorspace $llx $lly Tl $urx $llx sub $ury $lly sub scale 8 -dict begin/ImageType 1 def/Width $wid def/Height $hei abs def/BitsPerComponent -$bts def/Decode $ncl 1 eq{[0 1]}{$ncl 3 eq{[0 1 0 1 0 1]}{[0 1 0 1 0 1 0 1]} -ifelse}ifelse def/ImageMatrix[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]def -/DataSource currentfile/ASCII85Decode filter COMP 1 eq{/DCTDecode filter}{COMP -2 eq{/RunLengthDecode filter}if}ifelse def currentdict end image $SDF{$dsf $dsa -$dsp @ss}if @gr $ctm setmatrix}bd}{/@I_2{}bd}ifelse/@I_3{@sm @gs @ii @np/$ury -xd/$urx xd/$lly xd/$llx xd/$ncl xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul -$ncl mul 8 div ceiling cvi string def $ngx $ncl 1 eq{/DeviceGray}{$ncl 3 eq -{/DeviceRGB}{/DeviceCMYK}ifelse}ifelse setcolorspace $llx $lly Tl $urx $llx sub -$ury $lly sub scale/ImageDataDict 8 dict def ImageDataDict begin/ImageType 1 -def/Width $wid def/Height $hei abs def/BitsPerComponent $bts def/Decode $ncl 1 -eq{[0 1]}{$ncl 3 eq{[0 1 0 1 0 1]}{[0 1 0 1 0 1 0 1]}ifelse}ifelse def -/ImageMatrix[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]def/DataSource -currentfile/ASCII85Decode filter COMP 1 eq{/DCTDecode filter}{COMP 2 eq{ -/RunLengthDecode filter}if}ifelse def end/MaskedImageDict 7 dict def -MaskedImageDict begin/ImageType 3 def/InterleaveType 3 def/MaskDict -ImageMaskDict def/DataDict ImageDataDict def end MaskedImageDict image $SDF -{$dsf $dsa $dsp @ss}if @gr $ctm setmatrix}bd/@SetMask{/$mbts xd/$mhei xd/$mwid -xd/ImageMaskDict 8 dict def ImageMaskDict begin/ImageType 1 def/Width $mwid def -/Height $mhei abs def/BitsPerComponent $mbts def/DataSource maskstream def -/ImageMatrix[$mwid 0 0 $mhei neg 0 $mhei 0 gt{$mhei}{0}ifelse]def/Decode[1 0] -def end}bd/@daq{dup type/arraytype eq{{}forall}if}bd/@BMP{/@cc xd UseLevel 3 eq -MaskedImage true eq and{7 -2 roll pop pop @I_3}{12 index 1 gt UseLevel 2 eq -UseLevel 3 eq or and{7 -2 roll pop pop @I_2}{11 index 1 eq{12 -1 roll pop @i}{ -7 -2 roll pop pop @I}ifelse}ifelse}ifelse}bd -% Copyright (c)1992-2002 Corel Corporation -% All rights reserved. v11.0 r0.0 -/@p{/$fil 1 def 1 eq dup/$vectpat xd{/$pfrg true def}{@gs $t $c $m $y $k $n $o -@scc_5/$pfrg xd @gr}ifelse/$pm xd/$psy xd/$psx xd/$pyf xd/$pxf xd/$pn xd}bd -/CorelPtrnDoFill{@gs $ctm setmatrix $pm concat CorelPtrnSetBBox wclip @sv Bburx -Bbury $pm itransform/$tury xd/$turx xd Bbllx Bblly $pm itransform/$tlly xd -/$tllx xd newpath $tllx $tlly m $tllx $tury l $turx $tury l $turx $tlly l $tllx -$tlly m @cp pathbbox @rs/$tury xd/$turx xd/$tlly xd/$tllx xd/$wid $turx $tllx -sub def/$hei $tury $tlly sub def @gs $vectpat{1 0 0 0 0 _ $o @scc_5{wfill}if}{ -$t $c $m $y $k $n $o @scc_5{SepMode_5 0 eq $pfrg or{$tllx $tlly Tl $wid $hei -scale <00> 8 1 false[8 0 0 1 0 0]{}imagemask}{/$bkg true def}ifelse}if}ifelse -@gr $wid 0 gt $hei 0 gt and{$pn cvlit load aload pop/$pd xd 3 -1 roll sub -/$phei xd exch sub/$pwid xd $wid $pwid div ceiling 1 add/$tlx xd $hei $phei div -ceiling 1 add/$tly xd currentdict/CorelPtrnL2Pattern known $psy 0 eq and $psx 0 -eq and{CorelPtrnL2Pattern}{$psx 0 eq{CorelPtrnTileVeritcal}{CorelPtrnTileHoriz -}ifelse}ifelse}if @gr @np/$bkg false def}bd/CorelPtrnSetBBox{pathbbox/$ury xd -/$urx xd/$lly xd/$llx xd}bd/CorelPtrnSetFirstTile{$tllx $pxf add dup $tllx gt -{$pwid sub}if/$tx xd $tury $pyf sub dup $tury lt{$phei add}if/$ty xd}bd/p{/$pm -xd 7 rp/$pyf xd/$pxf xd/$pn xd/$fil 1 def}bd/CorelPtrnDraw{@ep}bd -/CorelPtrnPutTile{@sv/$in true def 2 copy dup $lly le{/$in false def}if $phei -sub $ury ge{/$in false def}if dup $urx ge{/$in false def}if $pwid add $llx le{ -/$in false def}if $in{@np 2 copy m $pwid 0 rl 0 $phei neg rl $pwid neg 0 rl 0 -$phei rl clip @np $pn cvlit load aload pop 7 -1 roll 5 index sub 7 -1 roll 3 -index sub Tl matrix currentmatrix/$ctm xd CorelPtrnDraw pop pop pop pop}{pop -pop}ifelse @rs}bd/CorelPtrnTileHoriz{CorelPtrnSetFirstTile 0 1 $tly 1 sub{dup -$psx mul $tx add{dup $llx gt{$pwid sub}{exit}ifelse}loop exch $phei mul $ty -exch sub 0 1 $tlx 1 sub{$pwid mul 3 copy 3 -1 roll add exch CorelPtrnPutTile -pop}for pop pop}for}bd/CorelPtrnTileVeritcal{CorelPtrnSetFirstTile 0 1 $tlx 1 -sub{dup $pwid mul $tx add exch $psy mul $ty exch sub{dup $ury lt{$phei add} -{exit}ifelse}loop 0 1 $tly 1 sub{$phei mul 3 copy sub CorelPtrnPutTile pop}for -pop pop}for}bd L2? UseLevel 2 ge and{/CorelPtrnL2Pattern{@sv[$pn cvlit load -aload pop pop]$pwid $phei $pn cvlit load aload pop pop pop pop pathbbox pop pop -2 index sub exch 3 index sub 4 -2 roll pop pop exch matrix identmatrix -translate/PatternMatrix xd/PatternYStep xd/PatternXStep xd/PatternBBox xd -currentdict/PatternMainDict xd <> -PatternMatrix makepattern setpattern fill @rs}def}if +%!PS-Adobe-3.0 EPSF-3.0 +%%For: +%%Title: +%%Creator: Scribus1.4.2 +%%Pages: 1 +%%BoundingBox: 0 0 282 282 +%%HiResBoundingBox: 0 0 282 282 +%%LanguageLevel: 3 +%%EndComments +%%BeginProlog +/Scribusdict 100 dict def +Scribusdict begin +/sp {showpage} bind def +/oldsetgray /setgray load def +/cmyk {setcmykcolor} def +/m {moveto} bind def +/l {lineto} bind def +/li {lineto} bind def +/cu {curveto} bind def +/cl {closepath} bind def +/gs {gsave} bind def +/gr {grestore} bind def +/tr {translate} bind def +/ro {rotate} bind def +/sh {show} bind def +/shg {setcmykcolor moveto glyphshow} def +/shgsp {moveto glyphshow} def +/sc {scale} bind def +/se {selectfont} bind def +/sf {setfont} bind def +/sw {setlinewidth} bind def +/f {findfont} bind def +/fi {fill} bind def +/st {stroke} bind def +/shgf {gs dup scale begin cvx exec fill end gr} bind def +/shgs {gs dup 1 exch div currentlinewidth mul sw dup scale + begin cvx exec st end gr} bind def +/bEPS { + /b4_Inc_state save def + /dict_count countdictstack def + /op_count count 1 sub def + userdict begin + /showpage { } def + 0 setgray 0 setlinecap + 1 setlinewidth 0 setlinejoin + 10 setmiterlimit [ ] 0 setdash newpath + /languagelevel where + {pop languagelevel + 1 ne + {false setstrokeadjust false setoverprint + } if } if } bind def +/eEPS { count op_count sub {pop} repeat + countdictstack dict_count sub {end} repeat + b4_Inc_state restore } bind def + end +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: 1 1 +%%PageOrientation: Portrait +Scribusdict begin +save +/DeviceCMYK setcolorspace +0 0 tr +0 0 m +282 0 li +282 282 li +0 282 li cl clip newpath +gs +0.708406 281.428 m +281.58 281.428 li +281.58 0.556 li +0.708406 0.556 li +0.708406 281.428 li +cl +eoclip newpath +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +0.816406 281.32 tr +280.656 -138.888 m +138.888 0 li +0 -141.696 li +138.888 -280.656 li +280.656 -138.888 li +cl +0 0 0 1 cmyk eofill +280.656 -138.888 m +138.888 0 li +0 -141.696 li +138.888 -280.656 li +280.656 -138.888 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +139.704 142.432 tr +127.584 0 m +136.08 0 li +0 -136.08 li +0 -127.584 li +127.584 0 li +cl +0.6 0 0.4 0.580392 cmyk eofill +127.584 0 m +136.08 0 li +0 -136.08 li +0 -127.584 li +127.584 0 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +6.50391 139.624 tr +0 0 m +8.49609 0 li +133.2 -124.776 li +133.2 -133.272 li +0 0 li +cl +0.6 0 0.4 0.509804 cmyk eofill +0 0 m +8.49609 0 li +133.2 -124.776 li +133.2 -133.272 li +0 0 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +6.50391 275.632 tr +133.2 -8.42384 m +133.2 0 li +0 -136.008 li +8.49609 -136.008 li +133.2 -8.42384 li +cl +0.6 0 0.4 0 cmyk eofill +133.2 -8.42384 m +133.2 0 li +0 -136.008 li +8.49609 -136.008 li +133.2 -8.42384 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +139.704 275.632 tr +0 0 m +0 -8.42384 li +127.584 -133.2 li +136.08 -133.2 li +0 0 li +cl +0.729412 0 0.988235 0 cmyk eofill +0 0 m +0 -8.42384 li +127.584 -133.2 li +136.08 -133.2 li +0 0 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +15 267.208 tr +124.704 -252.36 m +252.288 -124.776 li +124.704 0 li +0 -127.584 li +124.704 -252.36 li +cl +0.6 0 0.4 0.4 cmyk eofill +124.704 -252.36 m +252.288 -124.776 li +124.704 0 li +0 -127.584 li +124.704 -252.36 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +18.8164 270.016 tr +147.384 -31.1758 m +155.88 -39.7431 li +97.2716 -99.2156 li +97.2716 -39.7431 li +102.96 -39.7431 li +111.456 -31.1758 li +111.456 -8.5674 li +102.96 0 li +8.4951 0 li +0 -8.5674 li +0 -31.1758 li +8.4951 -39.7431 li +15.1191 -39.7431 li +15.1191 -232.488 li +25.4873 -240.984 li +54.792 -240.984 li +257.904 -31.1758 li +257.904 -8.5674 li +249.408 0 li +156.816 0 li +147.384 -8.5674 li +147.384 -31.1758 li +cl +0 0 0 1 cmyk eofill +147.384 -31.1758 m +155.88 -39.7431 li +97.2716 -99.2156 li +97.2716 -39.7431 li +102.96 -39.7431 li +111.456 -31.1758 li +111.456 -8.5674 li +102.96 0 li +8.4951 0 li +0 -8.5674 li +0 -31.1758 li +8.4951 -39.7431 li +15.1191 -39.7431 li +15.1191 -232.488 li +25.4873 -240.984 li +54.792 -240.984 li +257.904 -31.1758 li +257.904 -8.5674 li +249.408 0 li +156.816 0 li +147.384 -8.5674 li +147.384 -31.1758 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +24.4316 264.4 tr +5.6885 -28.4404 m +0 -22.752 li +0 -5.7608 li +5.6885 -0.0723 li +94.5364 0 li +100.152 -5.7608 li +94.5364 -8.4961 li +91.6564 -5.7608 li +5.6885 -19.8721 li +5.6885 -28.4404 li +cl +0 0 0 0 cmyk eofill +5.6885 -28.4404 m +0 -22.752 li +0 -5.7608 li +5.6885 -0.0723 li +94.5364 0 li +100.152 -5.7608 li +94.5364 -8.4961 li +91.6564 -5.7608 li +5.6885 -19.8721 li +5.6885 -28.4404 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +40.4883 241.648 tr +6.624 -206.928 m +0 -201.24 li +0 -5.6162 li +6.624 0 li +6.624 -206.928 li +cl +0 0 0 0 cmyk eofill +6.624 -206.928 m +0 -201.24 li +0 -5.6162 li +6.624 0 li +6.624 -206.928 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +100.032 241.648 tr +88.848 -5.6884 m +94.536 0 li +94.536 -11.3759 li +0 -107.712 li +10.44 -85.0324 li +88.848 -5.6884 li +cl +0 0 0 0 cmyk eofill +88.848 -5.6884 m +94.536 0 li +94.536 -11.3759 li +0 -107.712 li +10.44 -85.0324 li +88.848 -5.6884 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +30.1201 247.336 tr +18.9356 -2.8798 m +16.9922 -5.6875 li +10.3682 -11.3759 li +0 -11.3759 li +0 0 li +18.9356 -2.8798 li +cl +0 0 0 0.501961 cmyk eofill +18.9356 -2.8798 m +16.9922 -5.6875 li +10.3682 -11.3759 li +0 -11.3759 li +0 0 li +18.9356 -2.8798 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +100.032 258.64 tr +10.44 -22.6796 m +10.44 -102.024 li +0 -124.632 li +0 -16.9199 li +16.056 -16.9199 li +18.936 -14.1113 li +16.056 0 li +24.552 0 li +24.552 -16.9912 li +18.936 -22.6796 li +10.44 -22.6796 li +cl +0 0 0 0.501961 cmyk eofill +10.44 -22.6796 m +10.44 -102.024 li +0 -124.632 li +0 -16.9199 li +16.056 -16.9199 li +18.936 -14.1113 li +16.056 0 li +24.552 0 li +24.552 -16.9912 li +18.936 -22.6796 li +10.44 -22.6796 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +171.888 264.328 tr +5.616 -28.3681 m +0 -22.6797 li +0 -5.6885 li +6.552 0 li +92.592 0 li +99.216 -5.6885 li +89.712 -14.1845 li +5.616 -19.7998 li +5.616 -28.3681 li +cl +0 0 0 0 cmyk eofill +5.616 -28.3681 m +0 -22.6797 li +0 -5.6885 li +6.552 0 li +92.592 0 li +99.216 -5.6885 li +89.712 -14.1845 li +5.616 -19.7998 li +5.616 -28.3681 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +47.1123 258.64 tr +223.992 -16.9912 m +24.5518 -223.92 li +0 -223.92 li +0 -215.424 li +18 -215.424 li +217.368 -11.3037 li +214.488 0 li +223.992 0 li +223.992 -16.9912 li +cl +0 0 0 0.501961 cmyk eofill +223.992 -16.9912 m +24.5518 -223.92 li +0 -223.92 li +0 -215.424 li +18 -215.424 li +217.368 -11.3037 li +214.488 0 li +223.992 0 li +223.992 -16.9912 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +177.504 247.336 tr +18.936 -2.8798 m +16.992 -5.6875 li +11.376 -11.3759 li +0 -11.3759 li +0 0 li +18.936 -2.8798 li +cl +0 0 0 0.501961 cmyk eofill +18.936 -2.8798 m +16.992 -5.6875 li +11.376 -11.3759 li +0 -11.3759 li +0 0 li +18.936 -2.8798 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +30.1201 258.712 tr +69.9119 -124.704 m +69.9119 -16.9922 li +85.9679 -16.9922 li +88.8479 -14.1836 li +88.8479 -2.8076 li +85.9679 0 li +2.8076 0 li +0 -2.8076 li +0 -14.1836 li +2.8076 -16.9922 li +16.9922 -16.9922 li +16.9922 -215.496 li +20.6641 -218.304 li +36.8643 -218.304 li +235.296 -11.376 li +235.296 -3.2402 li +232.416 0 li +150.264 0 li +147.384 -2.8076 li +147.384 -14.2558 li +150.264 -17.0635 li +164.448 -17.0635 li +164.448 -28.4394 li +69.9119 -124.704 li +cl +0 0 0 0.2 cmyk eofill +69.9119 -124.704 m +69.9119 -16.9922 li +85.9679 -16.9922 li +88.8479 -14.1836 li +88.8479 -2.8076 li +85.9679 0 li +2.8076 0 li +0 -2.8076 li +0 -14.1836 li +2.8076 -16.9922 li +16.9922 -16.9922 li +16.9922 -215.496 li +20.6641 -218.304 li +36.8643 -218.304 li +235.296 -11.376 li +235.296 -3.2402 li +232.416 0 li +150.264 0 li +147.384 -2.8076 li +147.384 -14.2558 li +150.264 -17.0635 li +164.448 -17.0635 li +164.448 -28.4394 li +69.9119 -124.704 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +145.896 139.552 tr +5.688 -5.688 m +12.312 0 li +29.304 0 li +34.056 -5.688 li +28.368 -22.68 li +21.816 -28.368 li +4.824 -28.368 li +0 -22.68 li +5.688 -5.688 li +cl +0 0 0 1 cmyk eofill +5.688 -5.688 m +12.312 0 li +29.304 0 li +34.056 -5.688 li +28.368 -22.68 li +21.816 -28.368 li +4.824 -28.368 li +0 -22.68 li +5.688 -5.688 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +157.272 108.376 tr +0 -68.04 m +17.064 -17.064 li +11.376 -17.064 li +17.064 0 li +42.48 0 li +48.168 -5.688 li +51.984 -5.688 li +57.6 0 li +76.536 0 li +82.224 -5.688 li +85.968 -5.688 li +91.656 0 li +112.392 0 li +119.952 -11.376 li +107.568 -51.696 li +113.184 -51.696 li +107.712 -68.04 li +73.656 -68.04 li +86.976 -28.368 li +78.48 -28.368 li +70.632 -51.552 li +76.248 -51.552 li +70.92 -68.04 li +36.864 -68.04 li +50.112 -28.368 li +41.616 -28.368 li +33.696 -51.696 li +39.384 -51.696 li +34.056 -68.04 li +0 -68.04 li +cl +0 0 0 1 cmyk eofill +0 -68.04 m +17.064 -17.064 li +11.376 -17.064 li +17.064 0 li +42.48 0 li +48.168 -5.688 li +51.984 -5.688 li +57.6 0 li +76.536 0 li +82.224 -5.688 li +85.968 -5.688 li +91.656 0 li +112.392 0 li +119.952 -11.376 li +107.568 -51.696 li +113.184 -51.696 li +107.712 -68.04 li +73.656 -68.04 li +86.976 -28.368 li +78.48 -28.368 li +70.632 -51.552 li +76.248 -51.552 li +70.92 -68.04 li +36.864 -68.04 li +50.112 -28.368 li +41.616 -28.368 li +33.696 -51.696 li +39.384 -51.696 li +34.056 -68.04 li +0 -68.04 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +164.832 102.688 tr +102.24 0 m +106.632 -6.264 li +92.664 -51.048 li +98.28 -51.048 li +96.408 -56.664 li +73.728 -56.664 li +86.976 -16.992 li +67.104 -16.992 li +55.8 -51.048 li +61.416 -51.048 li +59.544 -56.664 li +36.864 -56.664 li +50.112 -16.992 li +30.24 -16.992 li +18.936 -51.048 li +24.624 -51.048 li +22.68 -56.664 li +0 -56.664 li +17.064 -5.688 li +11.376 -5.688 li +13.248 0 li +34.056 0 li +39.744 -5.688 li +45.36 -5.688 li +51.048 0 li +68.04 0 li +73.728 -5.688 li +79.416 -5.688 li +85.104 0 li +102.24 0 li +cl +0 0 0 0.2 cmyk eofill +102.24 0 m +106.632 -6.264 li +92.664 -51.048 li +98.28 -51.048 li +96.408 -56.664 li +73.728 -56.664 li +86.976 -16.992 li +67.104 -16.992 li +55.8 -51.048 li +61.416 -51.048 li +59.544 -56.664 li +36.864 -56.664 li +50.112 -16.992 li +30.24 -16.992 li +18.936 -51.048 li +24.624 -51.048 li +22.68 -56.664 li +0 -56.664 li +17.064 -5.688 li +11.376 -5.688 li +13.248 0 li +34.056 0 li +39.744 -5.688 li +45.36 -5.688 li +51.048 0 li +68.04 0 li +73.728 -5.688 li +79.416 -5.688 li +85.104 0 li +102.24 0 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +120.408 108.376 tr +51.048 0 m +33.696 -51.624 li +39.6 -51.624 li +33.984 -68.04 li +0 -68.04 li +16.992 -17.064 li +11.304 -17.064 li +51.048 0 li +cl +11.304 -17.064 m +16.992 0 li +51.048 0 li +11.304 -17.064 li +cl +0 0 0 1 cmyk eofill +51.048 0 m +33.696 -51.624 li +39.6 -51.624 li +33.984 -68.04 li +0 -68.04 li +16.992 -17.064 li +11.304 -17.064 li +51.048 0 li +cl +11.304 -17.064 m +16.992 0 li +51.048 0 li +11.304 -17.064 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +127.968 102.688 tr +22.68 -56.664 m +24.552 -51.048 li +18.864 -51.048 li +35.928 0 li +12.312 0 li +10.368 -5.688 li +16.992 -5.688 li +0 -56.664 li +22.68 -56.664 li +cl +0 0 0 0.2 cmyk eofill +22.68 -56.664 m +24.552 -51.048 li +18.864 -51.048 li +35.928 0 li +12.312 0 li +10.368 -5.688 li +16.992 -5.688 li +0 -56.664 li +22.68 -56.664 li +cl +0 0 0 1 cmyk st +gr +gs +0.216 sw +0 setlinecap +0 setlinejoin +[] 0 setdash +152.52 133.864 tr +16.992 -14.184 m +20.808 -2.808 li +18.936 0 li +7.56 0 li +3.816 -2.808 li +0 -14.184 li +1.944 -16.992 li +13.32 -16.992 li +16.992 -14.184 li +cl +0 0 0 0.2 cmyk eofill +16.992 -14.184 m +20.808 -2.808 li +18.936 0 li +7.56 0 li +3.816 -2.808 li +0 -14.184 li +1.944 -16.992 li +13.32 -16.992 li +16.992 -14.184 li +cl +0 0 0 1 cmyk st +gr +gr +%%PageTrailer +restore +gs +gr +sp end -%%EndResource -%%EndProlog -%%BeginSetup -wCorel11Dict begin -@BeginSysCorelDict -2.6131 setmiterlimit -1.00 setflat -/$fst 128 def -%%EndSetup - -%%Page: 1 1 -%LogicalPage: 1 -%%BeginPageSetup -@sv -@sm -@sv -%%EndPageSetup -@rax %Note: Object -147.81600 74.66400 428.47200 355.32000 @E - 0 O 0 @g -0.00 0.00 0.00 1.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -428.47200 216.43200 m -286.70400 355.32000 L -147.81600 213.62400 L -286.70400 74.66400 L -428.47200 216.43200 L -@c -B - -@rax %Note: Object -286.70400 80.35200 422.78400 216.43200 @E - 0 O 0 @g -0.60 0.00 0.40 0.58 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -414.28800 216.43200 m -422.78400 216.43200 L -286.70400 80.35200 L -286.70400 88.84800 L -414.28800 216.43200 L -@c -B - -@rax %Note: Object -153.50400 80.35200 286.70400 213.62400 @E - 0 O 0 @g -0.60 0.00 0.40 0.51 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -153.50400 213.62400 m -162.00000 213.62400 L -286.70400 88.84800 L -286.70400 80.35200 L -153.50400 213.62400 L -@c -B - -@rax %Note: Object -153.50400 213.62400 286.70400 349.63200 @E - 0 O 0 @g -0.60 0.00 0.40 0.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -286.70400 341.20800 m -286.70400 349.63200 L -153.50400 213.62400 L -162.00000 213.62400 L -286.70400 341.20800 L -@c -B - -@rax %Note: Object -286.70400 216.43200 422.78400 349.63200 @E - 0 O 0 @g -0.73 0.00 0.99 0.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -286.70400 349.63200 m -286.70400 341.20800 L -414.28800 216.43200 L -422.78400 216.43200 L -286.70400 349.63200 L -@c -B - -@rax %Note: Object -162.00000 88.84800 414.28800 341.20800 @E - 0 O 0 @g -0.60 0.00 0.40 0.40 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -286.70400 88.84800 m -414.28800 216.43200 L -286.70400 341.20800 L -162.00000 213.62400 L -286.70400 88.84800 L -@c -B - -@rax %Note: Object -165.81600 103.03200 423.72000 344.01600 @E - 0 O 0 @g -0.00 0.00 0.00 1.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -313.20000 312.84000 m -321.69600 304.27200 L -321.69600 304.27200 L -263.08800 244.80000 L -263.08800 304.27200 L -268.77600 304.27200 L -277.27200 312.84000 L -277.27200 335.44800 L -268.77600 344.01600 L -174.31200 344.01600 L -165.81600 335.44800 L -165.81600 312.84000 L -174.31200 304.27200 L -180.93600 304.27200 L -180.93600 111.52800 L -191.30400 103.03200 L -220.60800 103.03200 L -423.72000 312.84000 L -423.72000 335.44800 L -415.22400 344.01600 L -322.63200 344.01600 L -313.20000 335.44800 L -313.20000 312.84000 L -@c -B - -@rax %Note: Object -171.43200 309.96000 271.58400 338.40000 @E - 0 O 0 @g -0.00 0.00 0.00 0.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -177.12000 309.96000 m -171.43200 315.64800 L -171.43200 332.64000 L -177.12000 338.32800 L -265.96800 338.40000 L -271.58400 332.64000 L -265.96800 329.90400 L -263.08800 332.64000 L -177.12000 318.52800 L -177.12000 309.96000 L -@c -B - -@rax %Note: Object -187.48800 108.72000 194.11200 315.64800 @E - 0 O 0 @g -0.00 0.00 0.00 0.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -194.11200 108.72000 m -187.48800 114.40800 L -187.48800 310.03200 L -194.11200 315.64800 L -194.11200 108.72000 L -@c -B - -@rax %Note: Object -247.03200 207.93600 341.56800 315.64800 @E - 0 O 0 @g -0.00 0.00 0.00 0.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -335.88000 309.96000 m -341.56800 315.64800 L -341.56800 304.27200 L -247.03200 207.93600 L -257.47200 230.61600 L -335.88000 309.96000 L -@c -B - -@rax %Note: Object -177.12000 309.96000 196.05600 321.33600 @E - 0 O 0 @g -0.00 0.00 0.00 0.50 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -196.05600 318.45600 m -194.11200 315.64800 L -187.48800 309.96000 L -177.12000 309.96000 L -177.12000 321.33600 L -196.05600 318.45600 L -@c -B - -@rax %Note: Object -247.03200 208.00800 271.58400 332.64000 @E - 0 O 0 @g -0.00 0.00 0.00 0.50 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -257.47200 309.96000 m -257.47200 230.61600 L -247.03200 208.00800 L -247.03200 315.72000 L -263.08800 315.72000 L -265.96800 318.52800 L -263.08800 332.64000 L -271.58400 332.64000 L -271.58400 315.64800 L -265.96800 309.96000 L -257.47200 309.96000 L -@c -B - -@rax %Note: Object -318.88800 309.96000 418.10400 338.32800 @E - 0 O 0 @g -0.00 0.00 0.00 0.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -324.50400 309.96000 m -318.88800 315.64800 L -318.88800 332.64000 L -325.44000 338.32800 L -411.48000 338.32800 L -418.10400 332.64000 L -408.60000 324.14400 L -324.50400 318.52800 L -324.50400 309.96000 L -@c -B - -@rax %Note: Object -194.11200 108.72000 418.10400 332.64000 @E - 0 O 0 @g -0.00 0.00 0.00 0.50 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -418.10400 315.64800 m -218.66400 108.72000 L -194.11200 108.72000 L -194.11200 117.21600 L -212.11200 117.21600 L -411.48000 321.33600 L -408.60000 332.64000 L -418.10400 332.64000 L -418.10400 315.64800 L -@c -B - -@rax %Note: Object -324.50400 309.96000 343.44000 321.33600 @E - 0 O 0 @g -0.00 0.00 0.00 0.50 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -343.44000 318.45600 m -341.49600 315.64800 L -335.88000 309.96000 L -324.50400 309.96000 L -324.50400 321.33600 L -343.44000 318.45600 L -@c -B - -@rax %Note: Object -177.12000 114.40800 412.41600 332.71200 @E - 0 O 0 @g -0.00 0.00 0.00 0.20 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -247.03200 208.00800 m -247.03200 315.72000 L -263.08800 315.72000 L -265.96800 318.52800 L -265.96800 329.90400 L -263.08800 332.71200 L -179.92800 332.71200 L -177.12000 329.90400 L -177.12000 318.52800 L -179.92800 315.72000 L -194.11200 315.72000 L -194.11200 117.21600 L -197.78400 114.40800 L -213.98400 114.40800 L -412.41600 321.33600 L -412.41600 329.47200 L -409.53600 332.71200 L -327.38400 332.71200 L -324.50400 329.90400 L -324.50400 318.45600 L -327.38400 315.64800 L -341.56800 315.64800 L -341.56800 304.27200 L -247.03200 208.00800 L -@c -B - -@rax %Note: Object -292.89600 185.18400 326.95200 213.55200 @E - 0 O 0 @g -0.00 0.00 0.00 1.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -298.58400 207.86400 m -305.20800 213.55200 L -322.20000 213.55200 L -326.95200 207.86400 L -321.26400 190.87200 L -314.71200 185.18400 L -297.72000 185.18400 L -292.89600 190.87200 L -298.58400 207.86400 L -@c -B - -@rax %Note: Object -304.27200 114.33600 424.22400 182.37600 @E - 0 O 0 @g -0.00 0.00 0.00 1.00 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -304.27200 114.33600 m -321.33600 165.31200 L -315.64800 165.31200 L -321.33600 182.37600 L -346.75200 182.37600 L -352.44000 176.68800 L -356.25600 176.68800 L -361.87200 182.37600 L -380.80800 182.37600 L -386.49600 176.68800 L -390.24000 176.68800 L -395.92800 182.37600 L -416.66400 182.37600 L -424.22400 171.00000 L -411.84000 130.68000 L -417.45600 130.68000 L -411.98400 114.33600 L -377.92800 114.33600 L -391.24800 154.00800 L -382.75200 154.00800 L -374.90400 130.82400 L -380.52000 130.82400 L -375.19200 114.33600 L -341.13600 114.33600 L -354.38400 154.00800 L -345.88800 154.00800 L -337.96800 130.68000 L -343.65600 130.68000 L -338.32800 114.33600 L -304.27200 114.33600 L -@c -B - -@rax %Note: Object -311.83200 120.02400 418.46400 176.68800 @E - 0 O 0 @g -0.00 0.00 0.00 0.20 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -414.07200 176.68800 m -418.46400 170.42400 L -404.49600 125.64000 L -410.11200 125.64000 L -408.24000 120.02400 L -385.56000 120.02400 L -398.80800 159.69600 L -378.93600 159.69600 L -367.63200 125.64000 L -373.24800 125.64000 L -371.37600 120.02400 L -348.69600 120.02400 L -361.94400 159.69600 L -342.07200 159.69600 L -330.76800 125.64000 L -336.45600 125.64000 L -334.51200 120.02400 L -311.83200 120.02400 L -328.89600 171.00000 L -323.20800 171.00000 L -325.08000 176.68800 L -345.88800 176.68800 L -351.57600 171.00000 L -357.19200 171.00000 L -362.88000 176.68800 L -379.87200 176.68800 L -385.56000 171.00000 L -391.24800 171.00000 L -396.93600 176.68800 L -414.07200 176.68800 L -@c -B - -@rax %Note: Object -267.40800 114.33600 318.45600 182.37600 @E - 0 O 0 @g -0.00 0.00 0.00 1.00 k -/$fm 0 def -318.45600 182.37600 m -301.10400 130.75200 L -307.00800 130.75200 L -301.39200 114.33600 L -267.40800 114.33600 L -284.40000 165.31200 L -278.71200 165.31200 L -318.45600 182.37600 L -@c -278.71200 165.31200 m -284.40000 182.37600 L -318.45600 182.37600 L -@c -F - -@rax %Note: Object -267.40800 114.33600 318.45600 182.37600 @E -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -318.45600 182.37600 m -301.10400 130.75200 L -307.00800 130.75200 L -301.39200 114.33600 L -267.40800 114.33600 L -284.40000 165.31200 L -278.71200 165.31200 L -@c -278.71200 165.31200 m -284.40000 182.37600 L -318.45600 182.37600 L -@c -S - -@rax %Note: Object -274.96800 120.02400 310.89600 176.68800 @E - 0 O 0 @g -0.00 0.00 0.00 0.20 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -297.64800 120.02400 m -299.52000 125.64000 L -293.83200 125.64000 L -310.89600 176.68800 L -287.28000 176.68800 L -285.33600 171.00000 L -291.96000 171.00000 L -274.96800 120.02400 L -297.64800 120.02400 L -@c -B - -@rax %Note: Object -299.52000 190.87200 320.32800 207.86400 @E - 0 O 0 @g -0.00 0.00 0.00 0.20 k -0 J 0 j [] 0 d 0 R 0 @G -0.00 0.00 0.00 1.00 K -0 0.21600 0.21600 0.00000 @w -/$fm 0 def -316.51200 193.68000 m -320.32800 205.05600 L -318.45600 207.86400 L -307.08000 207.86400 L -303.33600 205.05600 L -299.52000 193.68000 L -301.46400 190.87200 L -312.84000 190.87200 L -316.51200 193.68000 L -@c -B - -%%PageTrailer -@rs -@rs -%%Trailer -@EndSysCorelDict -end -%%DocumentSuppliedResources: procset wCorel11Dict 11.0 0 -%%EOF +%%Trailer +%%EOF diff --git a/src/po/uk.cp1251.po b/src/po/uk.cp1251.po index 7e2457f3d3..b3cc871070 100644 --- a/src/po/uk.cp1251.po +++ b/src/po/uk.cp1251.po @@ -2,14 +2,12 @@ # Ukrainian Vim translation [uk] # # Copyright (C) 2001 Bohdan Vlasyuk +# Bohdan donated this work to be distributed with Vim under the Vim license. # # Thanks to: # Dmytro Kovalov for useful suggestions # Dmytro O. Redchuk for viminfo bug # -# Please, see readme at htpp://www.vstu.edu.ua/~bohdan/vim before any -# complains, and even if you won't complain, read it anyway. -# msgid "" msgstr "" "Project-Id-Version: vim 7.4\n" diff --git a/src/po/uk.po b/src/po/uk.po index 9dd77f8967..645a992785 100644 --- a/src/po/uk.po +++ b/src/po/uk.po @@ -2,14 +2,12 @@ # Ukrainian Vim translation [uk] # # Copyright (C) 2001 Bohdan Vlasyuk +# Bohdan donated this work to be distributed with Vim under the Vim license. # # Thanks to: # Dmytro Kovalov for useful suggestions # Dmytro O. Redchuk for viminfo bug # -# Please, see readme at htpp://www.vstu.edu.ua/~bohdan/vim before any -# complains, and even if you won't complain, read it anyway. -# msgid "" msgstr "" "Project-Id-Version: vim 7.4\n" From a41b958f8d5faf19f8db1da8438ce2014478a36a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 00:34:53 +0100 Subject: [PATCH 022/105] updated for version 7.4.063 Problem: Crash when using invalid key in Python dictionary. Solution: Check for object to be NULL. Add tests. (ZyX) --- src/if_py_both.h | 3 +++ src/testdir/test86.in | 3 +++ src/testdir/test86.ok | 3 +++ src/testdir/test87.in | 3 +++ src/testdir/test87.ok | 3 +++ src/version.c | 2 ++ 6 files changed, 17 insertions(+) diff --git a/src/if_py_both.h b/src/if_py_both.h index 6ea0afff62..748577981c 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -1624,6 +1624,9 @@ DictionaryContains(DictionaryObject *self, PyObject *keyObject) PyObject *rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); int ret; + if (rObj == NULL) + return -1; + ret = (rObj == Py_True); Py_DECREF(rObj); diff --git a/src/testdir/test86.in b/src/testdir/test86.in index ba3557be30..48fa4e5a1d 100644 --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -1088,6 +1088,9 @@ ee('d.get("a", 2, 3)') stringtochars_test('d.get(%s)') ee('d.pop("a")') ee('dl.pop("a")') +cb.append(">> DictionaryContains") +ee('"" in d') +ee('0 in d') cb.append(">> DictionaryIterNext") ee('for i in ned: ned["a"] = 1') del i diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok index c8517b3dcd..69c98d02d3 100644 --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -516,6 +516,9 @@ d.get("\0"):TypeError:('expected string without null bytes',) <<< Finished d.pop("a"):KeyError:('a',) dl.pop("a"):error:('dictionary is locked',) +>> DictionaryContains +"" in d:ValueError:('empty keys are not allowed',) +0 in d:TypeError:('expected str() or unicode() instance, but got int',) >> DictionaryIterNext for i in ned: ned["a"] = 1:RuntimeError:('hashtab changed during iteration',) >> DictionaryAssItem diff --git a/src/testdir/test87.in b/src/testdir/test87.in index 0ee6df3b2a..54cd97748f 100644 --- a/src/testdir/test87.in +++ b/src/testdir/test87.in @@ -1039,6 +1039,9 @@ ee('d.get("a", 2, 3)') stringtochars_test('d.get(%s)') ee('d.pop("a")') ee('dl.pop("a")') +cb.append(">> DictionaryContains") +ee('"" in d') +ee('0 in d') cb.append(">> DictionaryIterNext") ee('for i in ned: ned["a"] = 1') del i diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok index 9a2d686cd9..eed179c5a9 100644 --- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -505,6 +505,9 @@ d.get("\0"):(, TypeError('expected bytes with no null',)) <<< Finished d.pop("a"):(, KeyError('a',)) dl.pop("a"):(, error('dictionary is locked',)) +>> DictionaryContains +"" in d:(, ValueError('empty keys are not allowed',)) +0 in d:(, TypeError('expected bytes() or str() instance, but got int',)) >> DictionaryIterNext for i in ned: ned["a"] = 1:(, RuntimeError('hashtab changed during iteration',)) >> DictionaryAssItem diff --git a/src/version.c b/src/version.c index 229672a30b..b46d791b45 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 63, /**/ 62, /**/ From 5dd7c1897695b6e1b7ddf3057008ebfbec85ecd0 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 00:34:53 +0100 Subject: [PATCH 023/105] Added tag v7-4-063 for changeset 9cedb4dfd4c8 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5afbeba730..d79b9bf174 100644 --- a/.hgtags +++ b/.hgtags @@ -2785,3 +2785,4 @@ fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 46ca8fcee5257cc036ac928d91b2a490cf47a956 v7-4-060 739074bdceb85d16b9e70791d91a59c2b846ed8d v7-4-061 d59a0b8e5584c6e093990abb1b1e640aff7620bd v7-4-062 +9cedb4dfd4c830783ac65128dbbb118da2e3c638 v7-4-063 From 1ea9e3bdb8a27a0a3c2473524ae850289ce8dc65 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 01:41:17 +0100 Subject: [PATCH 024/105] updated for version 7.4.064 Problem: When replacing a character in Visual block mode, entering a CR does not cause a repeated line break. Solution: Recognize the situation and repeat the line break. (Christian Brabandt) --- src/normal.c | 7 +++++++ src/ops.c | 47 +++++++++++++++++++++++++++++++----------- src/testdir/test39.in | 4 ++++ src/testdir/test39.ok | Bin 244 -> 340 bytes src/version.c | 2 ++ 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/normal.c b/src/normal.c index 87e979d1df..9349be2bb4 100644 --- a/src/normal.c +++ b/src/normal.c @@ -7036,6 +7036,13 @@ nv_replace(cap) { if (got_int) reset_VIsual(); + if (had_ctrl_v) + { + if (cap->nchar == '\r') + cap->nchar = -1; + else if (cap->nchar == '\n') + cap->nchar = -2; + } nv_operator(cap); return; } diff --git a/src/ops.c b/src/ops.c index 4a198487cc..1f2e97eea1 100644 --- a/src/ops.c +++ b/src/ops.c @@ -2074,10 +2074,15 @@ op_replace(oap, c) char_u *newp, *oldp; size_t oldlen; struct block_def bd; + char_u *after_p = NULL; + int had_ctrl_v_cr = (c == -1 || c == -2); if ((curbuf->b_ml.ml_flags & ML_EMPTY ) || oap->empty) return OK; /* nothing to do */ + if (had_ctrl_v_cr) + c = (c == -1 ? '\r' : '\n'); + #ifdef FEAT_MBYTE if (has_mbyte) mb_adjust_opend(oap); @@ -2164,25 +2169,43 @@ op_replace(oap, c) /* insert pre-spaces */ copy_spaces(newp + bd.textcol, (size_t)bd.startspaces); /* insert replacement chars CHECK FOR ALLOCATED SPACE */ -#ifdef FEAT_MBYTE - if (has_mbyte) + /* -1/-2 is used for entering CR literally. */ + if (had_ctrl_v_cr || (c != '\r' && c != '\n')) { - n = (int)STRLEN(newp); - while (--num_chars >= 0) - n += (*mb_char2bytes)(c, newp + n); +#ifdef FEAT_MBYTE + if (has_mbyte) + { + n = (int)STRLEN(newp); + while (--num_chars >= 0) + n += (*mb_char2bytes)(c, newp + n); + } + else +#endif + copy_chars(newp + STRLEN(newp), (size_t)numc, c); + if (!bd.is_short) + { + /* insert post-spaces */ + copy_spaces(newp + STRLEN(newp), (size_t)bd.endspaces); + /* copy the part after the changed part */ + STRMOVE(newp + STRLEN(newp), oldp); + } } else -#endif - copy_chars(newp + STRLEN(newp), (size_t)numc, c); - if (!bd.is_short) { - /* insert post-spaces */ - copy_spaces(newp + STRLEN(newp), (size_t)bd.endspaces); - /* copy the part after the changed part */ - STRMOVE(newp + STRLEN(newp), oldp); + /* Replacing with \r or \n means splitting the line. */ + after_p = alloc_check((unsigned)oldlen + 1 + n - STRLEN(newp)); + if (after_p != NULL) + STRMOVE(after_p, oldp); } /* replace the line */ ml_replace(curwin->w_cursor.lnum, newp, FALSE); + if (after_p != NULL) + { + ml_append(curwin->w_cursor.lnum++, after_p, 0, FALSE); + appended_lines_mark(curwin->w_cursor.lnum, 1L); + oap->end.lnum++; + vim_free(after_p); + } } } else diff --git a/src/testdir/test39.in b/src/testdir/test39.in index d39ba82d9e..96995e0896 100644 --- a/src/testdir/test39.in +++ b/src/testdir/test39.in @@ -32,6 +32,10 @@ Oblah di doh dutVkUj :" Uppercase part of two lines ddppi333k0i222fyllvjfuUk +:" visual replace using Enter or NL +G3o1234567892k05l2jr G3o987652k02l2jr +G3o1234567892k05l2jr +G3o987652k02l2jr :/^the/,$w >> test.out :qa! ENDTEST diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok index 38a5bc3a683b375df61b0a24ff4f78a98522fb66..4ebecf6cde60bfb4f90cf2960c4ffec2011efbda 100644 GIT binary patch delta 103 tcmeyuc!g=gmjpv2V-r&@a|=r@Y%EI)UNciJWD=VygqWoT16VzR1OSO=6P*A6 delta 6 Ncmcb@^o4Q47XS+H15f|} diff --git a/src/version.c b/src/version.c index b46d791b45..6610be7bb0 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 64, /**/ 63, /**/ From ce3e12a0a2438d0ad4dd0597ce47492cfda2b367 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 01:41:17 +0100 Subject: [PATCH 025/105] Added tag v7-4-064 for changeset d06223965468 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index d79b9bf174..3a2104a7aa 100644 --- a/.hgtags +++ b/.hgtags @@ -2786,3 +2786,4 @@ fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 739074bdceb85d16b9e70791d91a59c2b846ed8d v7-4-061 d59a0b8e5584c6e093990abb1b1e640aff7620bd v7-4-062 9cedb4dfd4c830783ac65128dbbb118da2e3c638 v7-4-063 +d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 From ea6781c56d3d89e60a10b17fc71a424016e8118a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 02:01:01 +0100 Subject: [PATCH 026/105] updated for version 7.4.065 Problem: When recording, the character typed at the hit-enter prompt is recorded twice. (Urtica Dioica) Solution: Avoid recording the character twice. (Christian Brabandt) --- src/message.c | 12 ++++++++++++ src/version.c | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/message.c b/src/message.c index 5f00c01c08..0bbd87fb35 100644 --- a/src/message.c +++ b/src/message.c @@ -887,6 +887,8 @@ wait_return(redraw) int oldState; int tmpState; int had_got_int; + int save_Recording; + FILE *save_scriptout; if (redraw == TRUE) must_redraw = CLEAR; @@ -957,11 +959,21 @@ wait_return(redraw) * typeahead buffer. */ ++no_mapping; ++allow_keys; + + /* Temporarily disable Recording. If Recording is active, the + * character will be recorded later, since it will be added to the + * typebuf after the loop */ + save_Recording = Recording; + save_scriptout = scriptout; + Recording = FALSE; + scriptout = NULL; c = safe_vgetc(); if (had_got_int && !global_busy) got_int = FALSE; --no_mapping; --allow_keys; + Recording = save_Recording; + scriptout = save_scriptout; #ifdef FEAT_CLIPBOARD /* Strange way to allow copying (yanking) a modeless selection at diff --git a/src/version.c b/src/version.c index 6610be7bb0..02cca4348b 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 65, /**/ 64, /**/ From f300bf5bc741e0d7c2c20abff5cb902aae3dc668 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 02:01:01 +0100 Subject: [PATCH 027/105] Added tag v7-4-065 for changeset 7f341db39d5b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3a2104a7aa..f23cc67c9a 100644 --- a/.hgtags +++ b/.hgtags @@ -2787,3 +2787,4 @@ fa8447ec582378ca8d2c0245bd4ac195876abf2b v7-4-058 d59a0b8e5584c6e093990abb1b1e640aff7620bd v7-4-062 9cedb4dfd4c830783ac65128dbbb118da2e3c638 v7-4-063 d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 +7f341db39d5bee0a9259a14a65e19bc9efa65417 v7-4-065 From d80d105105f40fa566fdaedeeee896480530f325 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 02:54:12 +0100 Subject: [PATCH 028/105] updated for version 7.4.066 Problem: MS-Windows: When there is a colon in the file name (sub-stream feature) the swap file name is wrong. Solution: Change the colon to "%". (Yasuhiro Matsumoto) --- src/memline.c | 54 ++++++++++++++++++++++++++++++++++----------- src/misc1.c | 21 +++++++++++++++--- src/proto/misc1.pro | 1 + src/version.c | 2 ++ 4 files changed, 62 insertions(+), 16 deletions(-) diff --git a/src/memline.c b/src/memline.c index 836ee04719..2f08557f82 100644 --- a/src/memline.c +++ b/src/memline.c @@ -4014,6 +4014,13 @@ get_file_in_dir(fname, dname) else retval = concat_fnames(dname, tail, TRUE); +#ifdef WIN3264 + if (retval != NULL) + for (t = gettail(retval); *t != NUL; mb_ptr_adv(t)) + if (*t == ':') + *t = '%'; +#endif + return retval; } @@ -4137,12 +4144,29 @@ findswapname(buf, dirp, old_fname) #ifndef SHORT_FNAME int r; #endif + char_u *buf_fname = buf->b_fname; #if !defined(SHORT_FNAME) \ - && ((!defined(UNIX) && !defined(OS2)) || defined(ARCHIE)) + && ((!defined(UNIX) && !defined(OS2)) || defined(ARCHIE)) # define CREATE_DUMMY_FILE FILE *dummyfd = NULL; +# ifdef WIN3264 + if (buf_fname != NULL && !mch_isFullName(buf_fname) + && vim_strchr(gettail(buf_fname), ':')) + { + char_u *t; + + buf_fname = vim_strsave(buf_fname); + if (buf_fname == NULL) + buf_fname = buf->b_fname; + else + for (t = gettail(buf_fname); *t != NUL; mb_ptr_adv(t)) + if (*t == ':') + *t = '%'; + } +# endif + /* * If we start editing a new file, e.g. "test.doc", which resides on an * MSDOS compatible filesystem, it is possible that the file @@ -4150,9 +4174,9 @@ findswapname(buf, dirp, old_fname) * this problem we temporarily create "test.doc". Don't do this when the * check below for a 8.3 file name is used. */ - if (!(buf->b_p_sn || buf->b_shortname) && buf->b_fname != NULL - && mch_getperm(buf->b_fname) < 0) - dummyfd = mch_fopen((char *)buf->b_fname, "w"); + if (!(buf->b_p_sn || buf->b_shortname) && buf_fname != NULL + && mch_getperm(buf_fname) < 0) + dummyfd = mch_fopen((char *)buf_fname, "w"); #endif /* @@ -4171,7 +4195,7 @@ findswapname(buf, dirp, old_fname) if (dir_name == NULL) /* out of memory */ fname = NULL; else - fname = makeswapname(buf->b_fname, buf->b_ffname, buf, dir_name); + fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name); for (;;) { @@ -4204,7 +4228,7 @@ findswapname(buf, dirp, old_fname) * It either contains two dots, is longer than 8 chars, or starts * with a dot. */ - tail = gettail(buf->b_fname); + tail = gettail(buf_fname); if ( vim_strchr(tail, '.') != NULL || STRLEN(tail) > (size_t)8 || *gettail(fname) == '.') @@ -4273,7 +4297,7 @@ findswapname(buf, dirp, old_fname) { buf->b_shortname = TRUE; vim_free(fname); - fname = makeswapname(buf->b_fname, buf->b_ffname, + fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name); continue; /* try again with b_shortname set */ } @@ -4344,7 +4368,7 @@ findswapname(buf, dirp, old_fname) { buf->b_shortname = TRUE; vim_free(fname); - fname = makeswapname(buf->b_fname, buf->b_ffname, + fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name); continue; /* try again with '.' replaced with '_' */ } @@ -4356,7 +4380,7 @@ findswapname(buf, dirp, old_fname) * viewing a help file or when the path of the file is different * (happens when all .swp files are in one directory). */ - if (!recoverymode && buf->b_fname != NULL + if (!recoverymode && buf_fname != NULL && !buf->b_help && !(buf->b_flags & BF_DUMMY)) { int fd; @@ -4433,7 +4457,7 @@ findswapname(buf, dirp, old_fname) { fclose(dummyfd); dummyfd = NULL; - mch_remove(buf->b_fname); + mch_remove(buf_fname); did_use_dummy = TRUE; } #endif @@ -4448,7 +4472,7 @@ findswapname(buf, dirp, old_fname) * user anyway. */ if (swap_exists_action != SEA_NONE - && has_autocmd(EVENT_SWAPEXISTS, buf->b_fname, buf)) + && has_autocmd(EVENT_SWAPEXISTS, buf_fname, buf)) choice = do_swapexists(buf, fname); if (choice == 0) @@ -4549,7 +4573,7 @@ findswapname(buf, dirp, old_fname) #ifdef CREATE_DUMMY_FILE /* Going to try another name, need the dummy file again. */ if (did_use_dummy) - dummyfd = mch_fopen((char *)buf->b_fname, "w"); + dummyfd = mch_fopen((char *)buf_fname, "w"); #endif } } @@ -4581,8 +4605,12 @@ findswapname(buf, dirp, old_fname) if (dummyfd != NULL) /* file has been created temporarily */ { fclose(dummyfd); - mch_remove(buf->b_fname); + mch_remove(buf_fname); } +#endif +#ifdef WIN3264 + if (buf_fname != buf->b_fname) + vim_free(buf_fname); #endif return fname; } diff --git a/src/misc1.c b/src/misc1.c index 2063d427e3..c349015ba0 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -4808,9 +4808,9 @@ gettail(fname) if (fname == NULL) return (char_u *)""; - for (p1 = p2 = fname; *p2; ) /* find last part of path */ + for (p1 = p2 = get_past_head(fname); *p2; ) /* find last part of path */ { - if (vim_ispathsep(*p2)) + if (vim_ispathsep_nocolon(*p2)) p1 = p2 + 1; mb_ptr_adv(p2); } @@ -4929,7 +4929,8 @@ get_past_head(path) } /* - * return TRUE if 'c' is a path separator. + * Return TRUE if 'c' is a path separator. + * Note that for MS-Windows this includes the colon. */ int vim_ispathsep(c) @@ -4952,6 +4953,20 @@ vim_ispathsep(c) #endif } +/* + * Like vim_ispathsep(c), but exclude the colon for MS-Windows. + */ + int +vim_ispathsep_nocolon(c) + int c; +{ + return vim_ispathsep(c) +#ifdef BACKSLASH_IN_FILENAME + && c != ':' +#endif + ; +} + #if defined(FEAT_SEARCHPATH) || defined(PROTO) /* * return TRUE if 'c' is a path list separator. diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index 035453569e..d6672e4948 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -69,6 +69,7 @@ char_u *gettail_sep __ARGS((char_u *fname)); char_u *getnextcomp __ARGS((char_u *fname)); char_u *get_past_head __ARGS((char_u *path)); int vim_ispathsep __ARGS((int c)); +int vim_ispathsep_nocolon __ARGS((int c)); int vim_ispathlistsep __ARGS((int c)); void shorten_dir __ARGS((char_u *str)); int dir_of_file_exists __ARGS((char_u *fname)); diff --git a/src/version.c b/src/version.c index 02cca4348b..615d86db59 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 66, /**/ 65, /**/ From cfd1a900e33ba4202bcb38a11ca6974e33e83b98 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 02:54:12 +0100 Subject: [PATCH 029/105] Added tag v7-4-066 for changeset 38b948f534e4 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index f23cc67c9a..ddeafaa4fc 100644 --- a/.hgtags +++ b/.hgtags @@ -2788,3 +2788,4 @@ d59a0b8e5584c6e093990abb1b1e640aff7620bd v7-4-062 9cedb4dfd4c830783ac65128dbbb118da2e3c638 v7-4-063 d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 7f341db39d5bee0a9259a14a65e19bc9efa65417 v7-4-065 +38b948f534e4646bf879cb4d30151474e093d139 v7-4-066 From d86b5ff26b46a10e6495d35769fa352fea3fd924 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 04:20:33 +0100 Subject: [PATCH 030/105] updated for version 7.4.067 Problem: After inserting comment leader, CTRL-\ CTRL-O does move the cursor. (Wiktor Ruben) Solution: Avoid moving the cursor. (Christian Brabandt) --- src/edit.c | 11 ++++++----- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/edit.c b/src/edit.c index d2f058a985..02d822524d 100644 --- a/src/edit.c +++ b/src/edit.c @@ -199,7 +199,7 @@ static void check_spell_redraw __ARGS((void)); static void spell_back_to_badword __ARGS((void)); static int spell_bad_len = 0; /* length of located bad word */ #endif -static void stop_insert __ARGS((pos_T *end_insert_pos, int esc)); +static void stop_insert __ARGS((pos_T *end_insert_pos, int esc, int nomove)); static int echeck_abbr __ARGS((int)); static int replace_pop __ARGS((void)); static void replace_join __ARGS((int off)); @@ -6698,7 +6698,7 @@ start_arrow(end_insert_pos) if (!arrow_used) /* something has been inserted */ { AppendToRedobuff(ESC_STR); - stop_insert(end_insert_pos, FALSE); + stop_insert(end_insert_pos, FALSE, FALSE); arrow_used = TRUE; /* this means we stopped the current insert */ } #ifdef FEAT_SPELL @@ -6787,9 +6787,10 @@ stop_arrow() * to another window/buffer. */ static void -stop_insert(end_insert_pos, esc) +stop_insert(end_insert_pos, esc, nomove) pos_T *end_insert_pos; int esc; /* called by ins_esc() */ + int nomove; /* , don't move cursor */ { int cc; char_u *ptr; @@ -6860,7 +6861,7 @@ stop_insert(end_insert_pos, esc) * Do this when ESC was used or moving the cursor up/down. * Check for the old position still being valid, just in case the text * got changed unexpectedly. */ - if (did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL + if (!nomove && did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL && curwin->w_cursor.lnum != end_insert_pos->lnum)) && end_insert_pos->lnum <= curbuf->b_ml.ml_line_count) { @@ -8377,7 +8378,7 @@ ins_esc(count, cmdchar, nomove) disabled_redraw = TRUE; return FALSE; /* repeat the insert */ } - stop_insert(&curwin->w_cursor, TRUE); + stop_insert(&curwin->w_cursor, TRUE, nomove); undisplay_dollar(); } diff --git a/src/version.c b/src/version.c index 615d86db59..93faccbdf0 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 67, /**/ 66, /**/ From 665f978cc1bba1b04cb8866791530d46fedd84d1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 04:20:34 +0100 Subject: [PATCH 031/105] Added tag v7-4-067 for changeset 86bf09a1b6d0 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ddeafaa4fc..ff168624a3 100644 --- a/.hgtags +++ b/.hgtags @@ -2789,3 +2789,4 @@ d59a0b8e5584c6e093990abb1b1e640aff7620bd v7-4-062 d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 7f341db39d5bee0a9259a14a65e19bc9efa65417 v7-4-065 38b948f534e4646bf879cb4d30151474e093d139 v7-4-066 +86bf09a1b6d0275131caf7ffc51598608e7242de v7-4-067 From 6792249ffd51a995163236b5a6b754c6267becd9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 04:57:50 +0100 Subject: [PATCH 032/105] updated for version 7.4.068 Problem: Cannot build Vim on Mac with non-Apple compilers. Solution: Remove the -no-cpp-precomp flag. (Misty De Meo) --- src/auto/configure | 4 ++-- src/configure.in | 7 ++++--- src/osdef.sh | 6 +----- src/version.c | 2 ++ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index bb079f0fc0..63da09823f 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4221,7 +4221,7 @@ rm -f core conftest.err conftest.$ac_objext \ MACOSX=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX" # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ @@ -4311,7 +4311,7 @@ fi if test "$GCC" = yes -a "$local_dir" != no; then echo 'void f(){}' > conftest.c - have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"` + have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"` have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` rm -f conftest.c conftest.o fi diff --git a/src/configure.in b/src/configure.in index df28a246b7..8f0dce4c3e 100644 --- a/src/configure.in +++ b/src/configure.in @@ -204,7 +204,8 @@ if test "`(uname) 2>/dev/null`" = Darwin; then OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" dnl TODO: use -arch i386 on Intel machines - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + dnl Removed -no-cpp-precomp, only for very old compilers. + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX" dnl If Carbon is found, assume we don't want X11 dnl unless it was specifically asked for (--with-x) @@ -262,8 +263,8 @@ if test "$cross_compiling" = no; then ]) if test "$GCC" = yes -a "$local_dir" != no; then echo 'void f(){}' > conftest.c - dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler) - have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"` + dnl Removed -no-cpp-precomp, only needed for OS X 10.2 (Ben Fowler) + have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"` have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` rm -f conftest.c conftest.o fi diff --git a/src/osdef.sh b/src/osdef.sh index d7d4f2ac26..6f9fea28b5 100755 --- a/src/osdef.sh +++ b/src/osdef.sh @@ -47,11 +47,7 @@ cat << EOF > osdef0.c #endif EOF -# Mac uses precompiled headers, but we need real headers here. -case `uname` in - Darwin) $CC -I. -I$srcdir -E -no-cpp-precomp osdef0.c >osdef0.cc;; - *) $CC -I. -I$srcdir -E osdef0.c >osdef0.cc;; -esac +$CC -I. -I$srcdir -E osdef0.c >osdef0.cc # insert a space in front of each line, so that a function name at the # start of the line is matched with "[)*, ]\1[ (]" diff --git a/src/version.c b/src/version.c index 93faccbdf0..a054f62c7b 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 68, /**/ 67, /**/ From f6ec604af885459125497650406e947fa818193a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 04:57:50 +0100 Subject: [PATCH 033/105] Added tag v7-4-068 for changeset efa40be729c2 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ff168624a3..ad6f8986b3 100644 --- a/.hgtags +++ b/.hgtags @@ -2790,3 +2790,4 @@ d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 7f341db39d5bee0a9259a14a65e19bc9efa65417 v7-4-065 38b948f534e4646bf879cb4d30151474e093d139 v7-4-066 86bf09a1b6d0275131caf7ffc51598608e7242de v7-4-067 +efa40be729c2c94c1d8d0bf95000c4a7d2976dbc v7-4-068 From 9221a63178a89086f4f5bc1ba412af78d47bb0fd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 5 Nov 2013 07:13:41 +0100 Subject: [PATCH 034/105] updated for version 7.4.069 Problem: Cannot right shift lines starting with #. Solution: Allow the right shift when 'cino' contains #N with N > 0. (Christian Brabandt) Refactor parsing 'cino', store the values in the buffer. --- runtime/doc/indent.txt | 12 +- src/buffer.c | 3 + src/edit.c | 6 +- src/eval.c | 2 +- src/ex_getln.c | 6 +- src/fold.c | 2 +- src/misc1.c | 798 ++++++++++++++++++++--------------------- src/ops.c | 7 +- src/option.c | 29 +- src/proto/misc1.pro | 1 + src/proto/option.pro | 2 +- src/structs.h | 39 ++ src/version.c | 2 + 13 files changed, 479 insertions(+), 430 deletions(-) diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index b700d15e33..3a2a208e85 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -545,10 +545,12 @@ The examples below assume a 'shiftwidth' of 4. (default 70 lines). *cino-#* - #N When N is non-zero recognize shell/Perl comments, starting with - '#'. Default N is zero: don't recognize '#' comments. Note - that lines starting with # will still be seen as preprocessor - lines. + #N When N is non-zero recognize shell/Perl comments starting with + '#', do not recognize preprocessor lines; allow right-shifting + lines that start with "#". + When N is zero (default): don't recognize '#' comments, do + recognize preprocessor lines; right-shifting lines that start + with "#" does not work. The defaults, spelled out in full, are: @@ -556,7 +558,7 @@ The defaults, spelled out in full, are: c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0 Vim puts a line in column 1 if: -- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'. +- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#0'. - It starts with a label (a keyword followed by ':', other than "case" and "default") and 'cinoptions' does not contain an 'L' entry with a positive value. diff --git a/src/buffer.c b/src/buffer.c index 7b02ddaf57..8973b42aae 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -211,7 +211,10 @@ open_buffer(read_stdin, eap, flags) /* if first time loading this buffer, init b_chartab[] */ if (curbuf->b_flags & BF_NEVERLOADED) + { (void)buf_init_chartab(curbuf, FALSE); + parse_cino(curbuf); + } /* * Set/reset the Changed flag first, autocmds may change the buffer. diff --git a/src/edit.c b/src/edit.c index 02d822524d..b4469e855a 100644 --- a/src/edit.c +++ b/src/edit.c @@ -8958,7 +8958,7 @@ ins_bs(c, mode, inserted_space_p) *inserted_space_p = FALSE; if (p_sta && in_indent) - ts = (int)get_sw_value(); + ts = (int)get_sw_value(curbuf); else ts = (int)get_sts_value(); /* Compute the virtual column where we want to be. Since @@ -9647,7 +9647,7 @@ ins_tab() * When nothing special, insert TAB like a normal character */ if (!curbuf->b_p_et - && !(p_sta && ind && curbuf->b_p_ts != get_sw_value()) + && !(p_sta && ind && curbuf->b_p_ts != get_sw_value(curbuf)) && get_sts_value() == 0) return TRUE; @@ -9663,7 +9663,7 @@ ins_tab() AppendToRedobuff((char_u *)"\t"); if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ - temp = (int)get_sw_value(); + temp = (int)get_sw_value(curbuf); else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */ temp = (int)get_sts_value(); else /* otherwise use 'tabstop' */ diff --git a/src/eval.c b/src/eval.c index 0468203cca..14ba4d8b2d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -16934,7 +16934,7 @@ f_shiftwidth(argvars, rettv) typval_T *argvars UNUSED; typval_T *rettv; { - rettv->vval.v_number = get_sw_value(); + rettv->vval.v_number = get_sw_value(curbuf); } /* diff --git a/src/ex_getln.c b/src/ex_getln.c index cdd59def88..7ec47c7028 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -2280,7 +2280,7 @@ getexmodeline(promptc, cookie, indent) if (c1 == Ctrl_T) { - long sw = get_sw_value(); + long sw = get_sw_value(curbuf); p = (char_u *)line_ga.ga_data; p[line_ga.ga_len] = NUL; @@ -2337,7 +2337,7 @@ redraw: p[line_ga.ga_len] = NUL; indent = get_indent_str(p, 8); --indent; - indent -= indent % get_sw_value(); + indent -= indent % get_sw_value(curbuf); } while (get_indent_str(p, 8) > indent) { @@ -4178,7 +4178,7 @@ expand_showtail(xp) /* * Prepare a string for expansion. * When expanding file names: The string will be used with expand_wildcards(). - * Copy the file name into allocated memory and add a '*' at the end. + * Copy "fname[len]" into allocated memory and add a '*' at the end. * When expanding other names: The string will be used with regcomp(). Copy * the name into allocated memory and prepend "^". */ diff --git a/src/fold.c b/src/fold.c index a1671fe667..cd58c9153c 100644 --- a/src/fold.c +++ b/src/fold.c @@ -3052,7 +3052,7 @@ foldlevelIndent(flp) flp->lvl = -1; } else - flp->lvl = get_indent_buf(buf, lnum) / get_sw_value(); + flp->lvl = get_indent_buf(buf, lnum) / get_sw_value(curbuf); if (flp->lvl > flp->wp->w_p_fdn) { flp->lvl = flp->wp->w_p_fdn; diff --git a/src/misc1.c b/src/misc1.c index c349015ba0..fa43657a47 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -1405,7 +1405,7 @@ open_line(dir, flags, second_line_indent) #ifdef FEAT_SMARTINDENT if (did_si) { - int sw = (int)get_sw_value(); + int sw = (int)get_sw_value(curbuf); if (p_sr) newindent -= newindent % sw; @@ -5342,8 +5342,6 @@ static int find_last_paren __ARGS((char_u *l, int start, int end)); static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment)); static int cin_is_cpp_namespace __ARGS((char_u *)); -static int ind_hash_comment = 0; /* # starts a comment */ - /* * Skip over white space and C comments within the line. * Also skip over Perl/shell comments if desired. @@ -5360,7 +5358,7 @@ cin_skipcomment(s) /* Perl/shell # comment comment continues until eol. Require a space * before # to avoid recognizing $#array. */ - if (ind_hash_comment != 0 && s != prev_s && *s == '#') + if (curbuf->b_ind_hash_comment != 0 && s != prev_s && *s == '#') { s += STRLEN(s); break; @@ -6639,201 +6637,229 @@ find_last_paren(l, start, end) return retval; } +/* + * Parse 'cinoptions' and set the values in "curbuf". + * Must be called when 'cinoptions', 'shiftwidth' and/or 'tabstop' changes. + */ + void +parse_cino(buf) + buf_T *buf; +{ + char_u *p; + char_u *l; + char_u *digits; + int n; + int divider; + int fraction = 0; + int sw = (int)get_sw_value(buf); + + /* + * Set the default values. + */ + /* Spaces from a block's opening brace the prevailing indent for that + * block should be. */ + buf->b_ind_level = sw; + + /* Spaces from the edge of the line an open brace that's at the end of a + * line is imagined to be. */ + buf->b_ind_open_imag = 0; + + /* Spaces from the prevailing indent for a line that is not preceded by + * an opening brace. */ + buf->b_ind_no_brace = 0; + + /* Column where the first { of a function should be located }. */ + buf->b_ind_first_open = 0; + + /* Spaces from the prevailing indent a leftmost open brace should be + * located. */ + buf->b_ind_open_extra = 0; + + /* Spaces from the matching open brace (real location for one at the left + * edge; imaginary location from one that ends a line) the matching close + * brace should be located. */ + buf->b_ind_close_extra = 0; + + /* Spaces from the edge of the line an open brace sitting in the leftmost + * column is imagined to be. */ + buf->b_ind_open_left_imag = 0; + + /* Spaces jump labels should be shifted to the left if N is non-negative, + * otherwise the jump label will be put to column 1. */ + buf->b_ind_jump_label = -1; + + /* Spaces from the switch() indent a "case xx" label should be located. */ + buf->b_ind_case = sw; + + /* Spaces from the "case xx:" code after a switch() should be located. */ + buf->b_ind_case_code = sw; + + /* Lineup break at end of case in switch() with case label. */ + buf->b_ind_case_break = 0; + + /* Spaces from the class declaration indent a scope declaration label + * should be located. */ + buf->b_ind_scopedecl = sw; + + /* Spaces from the scope declaration label code should be located. */ + buf->b_ind_scopedecl_code = sw; + + /* Amount K&R-style parameters should be indented. */ + buf->b_ind_param = sw; + + /* Amount a function type spec should be indented. */ + buf->b_ind_func_type = sw; + + /* Amount a cpp base class declaration or constructor initialization + * should be indented. */ + buf->b_ind_cpp_baseclass = sw; + + /* additional spaces beyond the prevailing indent a continuation line + * should be located. */ + buf->b_ind_continuation = sw; + + /* Spaces from the indent of the line with an unclosed parentheses. */ + buf->b_ind_unclosed = sw * 2; + + /* Spaces from the indent of the line with an unclosed parentheses, which + * itself is also unclosed. */ + buf->b_ind_unclosed2 = sw; + + /* Suppress ignoring spaces from the indent of a line starting with an + * unclosed parentheses. */ + buf->b_ind_unclosed_noignore = 0; + + /* If the opening paren is the last nonwhite character on the line, and + * b_ind_unclosed_wrapped is nonzero, use this indent relative to the outer + * context (for very long lines). */ + buf->b_ind_unclosed_wrapped = 0; + + /* Suppress ignoring white space when lining up with the character after + * an unclosed parentheses. */ + buf->b_ind_unclosed_whiteok = 0; + + /* Indent a closing parentheses under the line start of the matching + * opening parentheses. */ + buf->b_ind_matching_paren = 0; + + /* Indent a closing parentheses under the previous line. */ + buf->b_ind_paren_prev = 0; + + /* Extra indent for comments. */ + buf->b_ind_comment = 0; + + /* Spaces from the comment opener when there is nothing after it. */ + buf->b_ind_in_comment = 3; + + /* Boolean: if non-zero, use b_ind_in_comment even if there is something + * after the comment opener. */ + buf->b_ind_in_comment2 = 0; + + /* Max lines to search for an open paren. */ + buf->b_ind_maxparen = 20; + + /* Max lines to search for an open comment. */ + buf->b_ind_maxcomment = 70; + + /* Handle braces for java code. */ + buf->b_ind_java = 0; + + /* Not to confuse JS object properties with labels. */ + buf->b_ind_js = 0; + + /* Handle blocked cases correctly. */ + buf->b_ind_keep_case_label = 0; + + /* Handle C++ namespace. */ + buf->b_ind_cpp_namespace = 0; + + /* Handle continuation lines containing conditions of if(), for() and + * while(). */ + buf->b_ind_if_for_while = 0; + + for (p = buf->b_p_cino; *p; ) + { + l = p++; + if (*p == '-') + ++p; + digits = p; /* remember where the digits start */ + n = getdigits(&p); + divider = 0; + if (*p == '.') /* ".5s" means a fraction */ + { + fraction = atol((char *)++p); + while (VIM_ISDIGIT(*p)) + { + ++p; + if (divider) + divider *= 10; + else + divider = 10; + } + } + if (*p == 's') /* "2s" means two times 'shiftwidth' */ + { + if (p == digits) + n = sw; /* just "s" is one 'shiftwidth' */ + else + { + n *= sw; + if (divider) + n += (sw * fraction + divider / 2) / divider; + } + ++p; + } + if (l[1] == '-') + n = -n; + + /* When adding an entry here, also update the default 'cinoptions' in + * doc/indent.txt, and add explanation for it! */ + switch (*l) + { + case '>': buf->b_ind_level = n; break; + case 'e': buf->b_ind_open_imag = n; break; + case 'n': buf->b_ind_no_brace = n; break; + case 'f': buf->b_ind_first_open = n; break; + case '{': buf->b_ind_open_extra = n; break; + case '}': buf->b_ind_close_extra = n; break; + case '^': buf->b_ind_open_left_imag = n; break; + case 'L': buf->b_ind_jump_label = n; break; + case ':': buf->b_ind_case = n; break; + case '=': buf->b_ind_case_code = n; break; + case 'b': buf->b_ind_case_break = n; break; + case 'p': buf->b_ind_param = n; break; + case 't': buf->b_ind_func_type = n; break; + case '/': buf->b_ind_comment = n; break; + case 'c': buf->b_ind_in_comment = n; break; + case 'C': buf->b_ind_in_comment2 = n; break; + case 'i': buf->b_ind_cpp_baseclass = n; break; + case '+': buf->b_ind_continuation = n; break; + case '(': buf->b_ind_unclosed = n; break; + case 'u': buf->b_ind_unclosed2 = n; break; + case 'U': buf->b_ind_unclosed_noignore = n; break; + case 'W': buf->b_ind_unclosed_wrapped = n; break; + case 'w': buf->b_ind_unclosed_whiteok = n; break; + case 'm': buf->b_ind_matching_paren = n; break; + case 'M': buf->b_ind_paren_prev = n; break; + case ')': buf->b_ind_maxparen = n; break; + case '*': buf->b_ind_maxcomment = n; break; + case 'g': buf->b_ind_scopedecl = n; break; + case 'h': buf->b_ind_scopedecl_code = n; break; + case 'j': buf->b_ind_java = n; break; + case 'J': buf->b_ind_js = n; break; + case 'l': buf->b_ind_keep_case_label = n; break; + case '#': buf->b_ind_hash_comment = n; break; + case 'N': buf->b_ind_cpp_namespace = n; break; + case 'k': buf->b_ind_if_for_while = n; break; + } + if (*p == ',') + ++p; + } +} + int get_c_indent() { - int sw = (int)get_sw_value(); - - /* - * spaces from a block's opening brace the prevailing indent for that - * block should be - */ - - int ind_level = sw; - - /* - * spaces from the edge of the line an open brace that's at the end of a - * line is imagined to be. - */ - int ind_open_imag = 0; - - /* - * spaces from the prevailing indent for a line that is not preceded by - * an opening brace. - */ - int ind_no_brace = 0; - - /* - * column where the first { of a function should be located } - */ - int ind_first_open = 0; - - /* - * spaces from the prevailing indent a leftmost open brace should be - * located - */ - int ind_open_extra = 0; - - /* - * spaces from the matching open brace (real location for one at the left - * edge; imaginary location from one that ends a line) the matching close - * brace should be located - */ - int ind_close_extra = 0; - - /* - * spaces from the edge of the line an open brace sitting in the leftmost - * column is imagined to be - */ - int ind_open_left_imag = 0; - - /* - * Spaces jump labels should be shifted to the left if N is non-negative, - * otherwise the jump label will be put to column 1. - */ - int ind_jump_label = -1; - - /* - * spaces from the switch() indent a "case xx" label should be located - */ - int ind_case = sw; - - /* - * spaces from the "case xx:" code after a switch() should be located - */ - int ind_case_code = sw; - - /* - * lineup break at end of case in switch() with case label - */ - int ind_case_break = 0; - - /* - * spaces from the class declaration indent a scope declaration label - * should be located - */ - int ind_scopedecl = sw; - - /* - * spaces from the scope declaration label code should be located - */ - int ind_scopedecl_code = sw; - - /* - * amount K&R-style parameters should be indented - */ - int ind_param = sw; - - /* - * amount a function type spec should be indented - */ - int ind_func_type = sw; - - /* - * amount a cpp base class declaration or constructor initialization - * should be indented - */ - int ind_cpp_baseclass = sw; - - /* - * additional spaces beyond the prevailing indent a continuation line - * should be located - */ - int ind_continuation = sw; - - /* - * spaces from the indent of the line with an unclosed parentheses - */ - int ind_unclosed = sw * 2; - - /* - * spaces from the indent of the line with an unclosed parentheses, which - * itself is also unclosed - */ - int ind_unclosed2 = sw; - - /* - * suppress ignoring spaces from the indent of a line starting with an - * unclosed parentheses. - */ - int ind_unclosed_noignore = 0; - - /* - * If the opening paren is the last nonwhite character on the line, and - * ind_unclosed_wrapped is nonzero, use this indent relative to the outer - * context (for very long lines). - */ - int ind_unclosed_wrapped = 0; - - /* - * suppress ignoring white space when lining up with the character after - * an unclosed parentheses. - */ - int ind_unclosed_whiteok = 0; - - /* - * indent a closing parentheses under the line start of the matching - * opening parentheses. - */ - int ind_matching_paren = 0; - - /* - * indent a closing parentheses under the previous line. - */ - int ind_paren_prev = 0; - - /* - * Extra indent for comments. - */ - int ind_comment = 0; - - /* - * spaces from the comment opener when there is nothing after it. - */ - int ind_in_comment = 3; - - /* - * boolean: if non-zero, use ind_in_comment even if there is something - * after the comment opener. - */ - int ind_in_comment2 = 0; - - /* - * max lines to search for an open paren - */ - int ind_maxparen = 20; - - /* - * max lines to search for an open comment - */ - int ind_maxcomment = 70; - - /* - * handle braces for java code - */ - int ind_java = 0; - - /* - * not to confuse JS object properties with labels - */ - int ind_js = 0; - - /* - * handle blocked cases correctly - */ - int ind_keep_case_label = 0; - - /* - * handle C++ namespace - */ - int ind_cpp_namespace = 0; - - /* - * handle continuation lines containing conditions of if(), for() and - * while() - */ - int ind_if_for_while = 0; - pos_T cur_curpos; int amount; int scope_amount; @@ -6868,10 +6894,6 @@ get_c_indent() int whilelevel; linenr_T lnum; - char_u *options; - char_u *digits; - int fraction = 0; /* init for GCC */ - int divider; int n; int iscase; int lookfor_break; @@ -6880,83 +6902,8 @@ get_c_indent() int original_line_islabel; int added_to_amount = 0; - for (options = curbuf->b_p_cino; *options; ) - { - l = options++; - if (*options == '-') - ++options; - digits = options; /* remember where the digits start */ - n = getdigits(&options); - divider = 0; - if (*options == '.') /* ".5s" means a fraction */ - { - fraction = atol((char *)++options); - while (VIM_ISDIGIT(*options)) - { - ++options; - if (divider) - divider *= 10; - else - divider = 10; - } - } - if (*options == 's') /* "2s" means two times 'shiftwidth' */ - { - if (options == digits) - n = sw; /* just "s" is one 'shiftwidth' */ - else - { - n *= sw; - if (divider) - n += (sw * fraction + divider / 2) / divider; - } - ++options; - } - if (l[1] == '-') - n = -n; - /* When adding an entry here, also update the default 'cinoptions' in - * doc/indent.txt, and add explanation for it! */ - switch (*l) - { - case '>': ind_level = n; break; - case 'e': ind_open_imag = n; break; - case 'n': ind_no_brace = n; break; - case 'f': ind_first_open = n; break; - case '{': ind_open_extra = n; break; - case '}': ind_close_extra = n; break; - case '^': ind_open_left_imag = n; break; - case 'L': ind_jump_label = n; break; - case ':': ind_case = n; break; - case '=': ind_case_code = n; break; - case 'b': ind_case_break = n; break; - case 'p': ind_param = n; break; - case 't': ind_func_type = n; break; - case '/': ind_comment = n; break; - case 'c': ind_in_comment = n; break; - case 'C': ind_in_comment2 = n; break; - case 'i': ind_cpp_baseclass = n; break; - case '+': ind_continuation = n; break; - case '(': ind_unclosed = n; break; - case 'u': ind_unclosed2 = n; break; - case 'U': ind_unclosed_noignore = n; break; - case 'W': ind_unclosed_wrapped = n; break; - case 'w': ind_unclosed_whiteok = n; break; - case 'm': ind_matching_paren = n; break; - case 'M': ind_paren_prev = n; break; - case ')': ind_maxparen = n; break; - case '*': ind_maxcomment = n; break; - case 'g': ind_scopedecl = n; break; - case 'h': ind_scopedecl_code = n; break; - case 'j': ind_java = n; break; - case 'J': ind_js = n; break; - case 'l': ind_keep_case_label = n; break; - case '#': ind_hash_comment = n; break; - case 'N': ind_cpp_namespace = n; break; - case 'k': ind_if_for_while = n; break; - } - if (*options == ',') - ++options; - } + /* make a copy, value is changed below */ + int ind_continuation = curbuf->b_ind_continuation; /* remember where the cursor was when we started */ cur_curpos = curwin->w_cursor; @@ -6990,22 +6937,21 @@ get_c_indent() curwin->w_cursor.col = 0; - original_line_islabel = cin_islabel(ind_maxcomment); /* XXX */ + original_line_islabel = cin_islabel(curbuf->b_ind_maxcomment); /* XXX */ /* * #defines and so on always go at the left when included in 'cinkeys'. */ if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', TRUE))) - { - amount = 0; - } + amount = curbuf->b_ind_hash_comment; /* * Is it a non-case label? Then that goes at the left margin too unless: * - JS flag is set. * - 'L' item has a positive value. */ - else if (original_line_islabel && !ind_js && ind_jump_label < 0) + else if (original_line_islabel && !curbuf->b_ind_js + && curbuf->b_ind_jump_label < 0) { amount = 0; } @@ -7027,7 +6973,8 @@ get_c_indent() * comment, try using the 'comments' option. */ else if (!cin_iscomment(theline) - && (trypos = find_start_comment(ind_maxcomment)) != NULL) /* XXX */ + && (trypos = find_start_comment(curbuf->b_ind_maxcomment)) != NULL) + /* XXX */ { int lead_start_len = 2; int lead_middle_len = 1; @@ -7161,7 +7108,7 @@ get_c_indent() } if (amount == -1) /* use the comment opener */ { - if (!ind_in_comment2) + if (!curbuf->b_ind_in_comment2) { start = ml_get(trypos->lnum); look = start + trypos->col + 2; /* skip / and * */ @@ -7170,8 +7117,8 @@ get_c_indent() } getvcol(curwin, trypos, &col, NULL, NULL); amount = col; - if (ind_in_comment2 || *look == NUL) - amount += ind_in_comment; + if (curbuf->b_ind_in_comment2 || *look == NUL) + amount += curbuf->b_ind_in_comment; } } } @@ -7179,9 +7126,11 @@ get_c_indent() /* * Are we inside parentheses or braces? */ /* XXX */ - else if (((trypos = find_match_paren(ind_maxparen, ind_maxcomment)) != NULL - && ind_java == 0) - || (tryposBrace = find_start_brace(ind_maxcomment)) != NULL + else if (((trypos = find_match_paren(curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) != NULL + && curbuf->b_ind_java == 0) + || (tryposBrace = + find_start_brace(curbuf->b_ind_maxcomment)) != NULL || trypos != NULL) { if (trypos != NULL && tryposBrace != NULL) @@ -7202,7 +7151,7 @@ get_c_indent() * If the matching paren is more than one line away, use the indent of * a previous non-empty line that matches the same paren. */ - if (theline[0] == ')' && ind_paren_prev) + if (theline[0] == ')' && curbuf->b_ind_paren_prev) { /* Line up with the start of the matching paren line. */ amount = get_indent_lnum(curwin->w_cursor.lnum - 1); /* XXX */ @@ -7221,7 +7170,8 @@ get_c_indent() curwin->w_cursor.lnum = lnum; /* Skip a comment. XXX */ - if ((trypos = find_start_comment(ind_maxcomment)) != NULL) + if ((trypos = find_start_comment(curbuf->b_ind_maxcomment)) + != NULL) { lnum = trypos->lnum + 1; continue; @@ -7229,8 +7179,8 @@ get_c_indent() /* XXX */ if ((trypos = find_match_paren( - corr_ind_maxparen(ind_maxparen, &cur_curpos), - ind_maxcomment)) != NULL + corr_ind_maxparen(curbuf->b_ind_maxparen, &cur_curpos), + curbuf->b_ind_maxcomment)) != NULL && trypos->lnum == our_paren_pos.lnum && trypos->col == our_paren_pos.col) { @@ -7258,7 +7208,7 @@ get_c_indent() int ignore_paren_col = 0; int is_if_for_while = 0; - if (ind_if_for_while) + if (curbuf->b_ind_if_for_while) { /* Look for the outermost opening parenthesis on this line * and check whether it belongs to an "if", "for" or "while". */ @@ -7273,7 +7223,8 @@ get_c_indent() curwin->w_cursor.lnum = outermost.lnum; curwin->w_cursor.col = outermost.col; - trypos = find_match_paren(ind_maxparen, ind_maxcomment); + trypos = find_match_paren(curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment); } while (trypos && trypos->lnum == outermost.lnum); curwin->w_cursor = cursor_save; @@ -7284,7 +7235,8 @@ get_c_indent() cin_is_if_for_while_before_offset(line, &outermost.col); } - amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment); + amount = skip_label(our_paren_pos.lnum, &look, + curbuf->b_ind_maxcomment); look = skipwhite(look); if (*look == '(') { @@ -7298,7 +7250,8 @@ get_c_indent() line = ml_get_curline(); look_col = (int)(look - line); curwin->w_cursor.col = look_col + 1; - if ((trypos = findmatchlimit(NULL, ')', 0, ind_maxparen)) + if ((trypos = findmatchlimit(NULL, ')', 0, + curbuf->b_ind_maxparen)) != NULL && trypos->lnum == our_paren_pos.lnum && trypos->col < our_paren_pos.col) @@ -7307,24 +7260,25 @@ get_c_indent() curwin->w_cursor.lnum = save_lnum; look = ml_get(our_paren_pos.lnum) + look_col; } - if (theline[0] == ')' || (ind_unclosed == 0 && is_if_for_while == 0) - || (!ind_unclosed_noignore && *look == '(' + if (theline[0] == ')' || (curbuf->b_ind_unclosed == 0 + && is_if_for_while == 0) + || (!curbuf->b_ind_unclosed_noignore && *look == '(' && ignore_paren_col == 0)) { /* * If we're looking at a close paren, line up right there; * otherwise, line up with the next (non-white) character. - * When ind_unclosed_wrapped is set and the matching paren is + * When b_ind_unclosed_wrapped is set and the matching paren is * the last nonwhite character of the line, use either the * indent of the current line or the indentation of the next - * outer paren and add ind_unclosed_wrapped (for very long + * outer paren and add b_ind_unclosed_wrapped (for very long * lines). */ if (theline[0] != ')') { cur_amount = MAXCOL; l = ml_get(our_paren_pos.lnum); - if (ind_unclosed_wrapped + if (curbuf->b_ind_unclosed_wrapped && cin_ends_in(l, (char_u *)"(", NULL)) { /* look for opening unmatched paren, indent one level @@ -7346,9 +7300,9 @@ get_c_indent() } our_paren_pos.col = 0; - amount += n * ind_unclosed_wrapped; + amount += n * curbuf->b_ind_unclosed_wrapped; } - else if (ind_unclosed_whiteok) + else if (curbuf->b_ind_unclosed_whiteok) our_paren_pos.col++; else { @@ -7374,12 +7328,12 @@ get_c_indent() } } - if (theline[0] == ')' && ind_matching_paren) + if (theline[0] == ')' && curbuf->b_ind_matching_paren) { /* Line up with the start of the matching paren line. */ } - else if ((ind_unclosed == 0 && is_if_for_while == 0) - || (!ind_unclosed_noignore + else if ((curbuf->b_ind_unclosed == 0 && is_if_for_while == 0) + || (!curbuf->b_ind_unclosed_noignore && *look == '(' && ignore_paren_col == 0)) { if (cur_amount != MAXCOL) @@ -7387,39 +7341,40 @@ get_c_indent() } else { - /* Add ind_unclosed2 for each '(' before our matching one, but - * ignore (void) before the line (ignore_paren_col). */ + /* Add b_ind_unclosed2 for each '(' before our matching one, + * but ignore (void) before the line (ignore_paren_col). */ col = our_paren_pos.col; while ((int)our_paren_pos.col > ignore_paren_col) { --our_paren_pos.col; switch (*ml_get_pos(&our_paren_pos)) { - case '(': amount += ind_unclosed2; + case '(': amount += curbuf->b_ind_unclosed2; col = our_paren_pos.col; break; - case ')': amount -= ind_unclosed2; + case ')': amount -= curbuf->b_ind_unclosed2; col = MAXCOL; break; } } - /* Use ind_unclosed once, when the first '(' is not inside + /* Use b_ind_unclosed once, when the first '(' is not inside * braces */ if (col == MAXCOL) - amount += ind_unclosed; + amount += curbuf->b_ind_unclosed; else { curwin->w_cursor.lnum = our_paren_pos.lnum; curwin->w_cursor.col = col; - if (find_match_paren(ind_maxparen, ind_maxcomment) != NULL) - amount += ind_unclosed2; + if (find_match_paren(curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment) != NULL) + amount += curbuf->b_ind_unclosed2; else { if (is_if_for_while) - amount += ind_if_for_while; + amount += curbuf->b_ind_if_for_while; else - amount += ind_unclosed; + amount += curbuf->b_ind_unclosed; } } /* @@ -7437,7 +7392,7 @@ get_c_indent() /* add extra indent for a comment */ if (cin_iscomment(theline)) - amount += ind_comment; + amount += curbuf->b_ind_comment; } /* @@ -7480,8 +7435,8 @@ get_c_indent() */ lnum = ourscope; if (find_last_paren(start, '(', ')') - && (trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) + && (trypos = find_match_paren(curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) != NULL) lnum = trypos->lnum; /* @@ -7490,11 +7445,11 @@ get_c_indent() * ldfd) { * } */ - if (ind_js || (ind_keep_case_label + if (curbuf->b_ind_js || (curbuf->b_ind_keep_case_label && cin_iscase(skipwhite(ml_get_curline()), FALSE))) amount = get_indent(); else - amount = skip_label(lnum, &l, ind_maxcomment); + amount = skip_label(lnum, &l, curbuf->b_ind_maxcomment); start_brace = BRACE_AT_END; } @@ -7510,7 +7465,7 @@ get_c_indent() * they may want closing braces to line up with something * other than the open brace. indulge them, if so. */ - amount += ind_close_extra; + amount += curbuf->b_ind_close_extra; } else { @@ -7523,14 +7478,14 @@ get_c_indent() lookfor = LOOKFOR_INITIAL; if (cin_iselse(theline)) lookfor = LOOKFOR_IF; - else if (cin_iswhileofdo(theline, cur_curpos.lnum, ind_maxparen)) - /* XXX */ + else if (cin_iswhileofdo(theline, cur_curpos.lnum, + curbuf->b_ind_maxparen)) /* XXX */ lookfor = LOOKFOR_DO; if (lookfor != LOOKFOR_INITIAL) { curwin->w_cursor.lnum = cur_curpos.lnum; - if (find_match(lookfor, ourscope, ind_maxparen, - ind_maxcomment) == OK) + if (find_match(lookfor, ourscope, curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment) == OK) { amount = get_indent(); /* XXX */ goto theend; @@ -7547,12 +7502,12 @@ get_c_indent() /* * if the '{' is _really_ at the left margin, use the imaginary * location of a left-margin brace. Otherwise, correct the - * location for ind_open_extra. + * location for b_ind_open_extra. */ if (start_brace == BRACE_IN_COL0) /* '{' is in column 0 */ { - amount = ind_open_left_imag; + amount = curbuf->b_ind_open_left_imag; lookfor_cpp_namespace = TRUE; } else if (start_brace == BRACE_AT_START && @@ -7565,16 +7520,16 @@ get_c_indent() { if (start_brace == BRACE_AT_END) /* '{' is at end of line */ { - amount += ind_open_imag; + amount += curbuf->b_ind_open_imag; l = skipwhite(ml_get_curline()); if (cin_is_cpp_namespace(l)) - amount += ind_cpp_namespace; + amount += curbuf->b_ind_cpp_namespace; } else { - /* Compensate for adding ind_open_extra later. */ - amount -= ind_open_extra; + /* Compensate for adding b_ind_open_extra later. */ + amount -= curbuf->b_ind_open_extra; if (amount < 0) amount = 0; } @@ -7585,20 +7540,22 @@ get_c_indent() if (cin_iscase(theline, FALSE)) /* it's a switch() label */ { lookfor = LOOKFOR_CASE; /* find a previous switch() label */ - amount += ind_case; + amount += curbuf->b_ind_case; } else if (cin_isscopedecl(theline)) /* private:, ... */ { lookfor = LOOKFOR_SCOPEDECL; /* class decl is this block */ - amount += ind_scopedecl; + amount += curbuf->b_ind_scopedecl; } else { - if (ind_case_break && cin_isbreak(theline)) /* break; ... */ + if (curbuf->b_ind_case_break && cin_isbreak(theline)) + /* break; ... */ lookfor_break = TRUE; lookfor = LOOKFOR_INITIAL; - amount += ind_level; /* ind_level from start of block */ + /* b_ind_level from start of block */ + amount += curbuf->b_ind_level; } scope_amount = amount; whilelevel = 0; @@ -7636,14 +7593,14 @@ get_c_indent() { if (curwin->w_cursor.lnum == 0 || curwin->w_cursor.lnum - < ourscope - ind_maxparen) + < ourscope - curbuf->b_ind_maxparen) { - /* nothing found (abuse ind_maxparen as limit) - * assume terminated line (i.e. a variable + /* nothing found (abuse curbuf->b_ind_maxparen as + * limit) assume terminated line (i.e. a variable * initialization) */ if (cont_amount > 0) amount = cont_amount; - else if (!ind_js) + else if (!curbuf->b_ind_js) amount += ind_continuation; break; } @@ -7654,7 +7611,7 @@ get_c_indent() * If we're in a comment now, skip to the start of the * comment. */ - trypos = find_start_comment(ind_maxcomment); + trypos = find_start_comment(curbuf->b_ind_maxcomment); if (trypos != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; @@ -7680,7 +7637,8 @@ get_c_indent() */ if (start_brace != BRACE_IN_COL0 || !cin_isfuncdecl(&l, curwin->w_cursor.lnum, - 0, ind_maxparen, ind_maxcomment)) + 0, curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) { /* if the line is terminated with another ',' * it is a continued variable initialization. @@ -7711,11 +7669,13 @@ get_c_indent() */ /* XXX */ trypos = NULL; if (find_last_paren(l, '(', ')')) - trypos = find_match_paren(ind_maxparen, - ind_maxcomment); + trypos = find_match_paren( + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment); if (trypos == NULL && find_last_paren(l, '{', '}')) - trypos = find_start_brace(ind_maxcomment); + trypos = find_start_brace( + curbuf->b_ind_maxcomment); if (trypos != NULL) { @@ -7750,8 +7710,8 @@ get_c_indent() amount = scope_amount; if (theline[0] == '{') { - amount += ind_open_extra; - added_to_amount = ind_open_extra; + amount += curbuf->b_ind_open_extra; + added_to_amount = curbuf->b_ind_open_extra; } } @@ -7773,7 +7733,8 @@ get_c_indent() /* If we're in a comment now, skip to the start of * the comment. */ - trypos = find_start_comment(ind_maxcomment); + trypos = find_start_comment( + curbuf->b_ind_maxcomment); if (trypos != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; @@ -7788,7 +7749,8 @@ get_c_indent() /* Finally the actual check for "namespace". */ if (cin_is_cpp_namespace(l)) { - amount += ind_cpp_namespace - added_to_amount; + amount += curbuf->b_ind_cpp_namespace + - added_to_amount; break; } @@ -7802,7 +7764,8 @@ get_c_indent() /* * If we're in a comment now, skip to the start of the comment. */ /* XXX */ - if ((trypos = find_start_comment(ind_maxcomment)) != NULL) + if ((trypos = find_start_comment(curbuf->b_ind_maxcomment)) + != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; curwin->w_cursor.col = 0; @@ -7856,8 +7819,9 @@ get_c_indent() * Check that this case label is not for another * switch() */ /* XXX */ - if ((trypos = find_start_brace(ind_maxcomment)) == - NULL || trypos->lnum == ourscope) + if ((trypos = find_start_brace( + curbuf->b_ind_maxcomment)) == NULL + || trypos->lnum == ourscope) { amount = get_indent(); /* XXX */ break; @@ -7900,9 +7864,10 @@ get_c_indent() if (l != NULL && cin_is_cinword(l)) { if (theline[0] == '{') - amount += ind_open_extra; + amount += curbuf->b_ind_open_extra; else - amount += ind_level + ind_no_brace; + amount += curbuf->b_ind_level + + curbuf->b_ind_no_brace; } break; } @@ -7916,8 +7881,10 @@ get_c_indent() * -> y = 1; */ scope_amount = get_indent() + (iscase /* XXX */ - ? ind_case_code : ind_scopedecl_code); - lookfor = ind_case_break ? LOOKFOR_NOBREAK : LOOKFOR_ANY; + ? curbuf->b_ind_case_code + : curbuf->b_ind_scopedecl_code); + lookfor = curbuf->b_ind_case_break + ? LOOKFOR_NOBREAK : LOOKFOR_ANY; continue; } @@ -7928,7 +7895,7 @@ get_c_indent() if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL) { if (find_last_paren(l, '{', '}') && (trypos = - find_start_brace(ind_maxcomment)) != NULL) + find_start_brace(curbuf->b_ind_maxcomment)) != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; curwin->w_cursor.col = 0; @@ -7939,7 +7906,7 @@ get_c_indent() /* * Ignore jump labels with nothing after them. */ - if (!ind_js && cin_islabel(ind_maxcomment)) + if (!curbuf->b_ind_js && cin_islabel(curbuf->b_ind_maxcomment)) { l = after_label(ml_get_curline()); if (l == NULL || cin_nocode(l)) @@ -7962,7 +7929,7 @@ get_c_indent() * constructor initialization? */ /* XXX */ n = FALSE; - if (lookfor != LOOKFOR_TERM && ind_cpp_baseclass > 0) + if (lookfor != LOOKFOR_TERM && curbuf->b_ind_cpp_baseclass > 0) { n = cin_is_cpp_baseclass(&col); l = ml_get_curline(); @@ -7985,8 +7952,10 @@ get_c_indent() } else /* XXX */ - amount = get_baseclass_amount(col, ind_maxparen, - ind_maxcomment, ind_cpp_baseclass); + amount = get_baseclass_amount(col, + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment, + curbuf->b_ind_cpp_baseclass); break; } else if (lookfor == LOOKFOR_CPP_BASECLASS) @@ -8029,8 +7998,8 @@ get_c_indent() */ (void)find_last_paren(l, '(', ')'); trypos = find_match_paren( - corr_ind_maxparen(ind_maxparen, &cur_curpos), - ind_maxcomment); + corr_ind_maxparen(curbuf->b_ind_maxparen, + &cur_curpos), curbuf->b_ind_maxcomment); /* * If we are looking for ',', we also look for matching @@ -8038,7 +8007,7 @@ get_c_indent() */ if (trypos == NULL && terminated == ',' && find_last_paren(l, '{', '}')) - trypos = find_start_brace(ind_maxcomment); + trypos = find_start_brace(curbuf->b_ind_maxcomment); if (trypos != NULL) { @@ -8081,9 +8050,9 @@ get_c_indent() * Get indent and pointer to text for current line, * ignoring any jump label. XXX */ - if (!ind_js) + if (!curbuf->b_ind_js) cur_amount = skip_label(curwin->w_cursor.lnum, - &l, ind_maxcomment); + &l, curbuf->b_ind_maxcomment); else cur_amount = get_indent(); /* @@ -8098,16 +8067,16 @@ get_c_indent() { amount = cur_amount; /* - * Only add ind_open_extra when the current line + * Only add b_ind_open_extra when the current line * doesn't start with a '{', which must have a match * in the same line (scope is the same). Probably: * { 1, 2 }, * -> { 3, 4 } */ if (*skipwhite(l) != '{') - amount += ind_open_extra; + amount += curbuf->b_ind_open_extra; - if (ind_cpp_baseclass) + if (curbuf->b_ind_cpp_baseclass) { /* have to look back, whether it is a cpp base * class declaration or initialization */ @@ -8155,10 +8124,11 @@ get_c_indent() */ amount = cur_amount; if (theline[0] == '{') - amount += ind_open_extra; + amount += curbuf->b_ind_open_extra; if (lookfor != LOOKFOR_TERM) { - amount += ind_level + ind_no_brace; + amount += curbuf->b_ind_level + + curbuf->b_ind_no_brace; break; } @@ -8192,10 +8162,11 @@ get_c_indent() curwin->w_cursor.col = (colnr_T)(l - ml_get_curline()) + 1; - if ((trypos = find_start_brace(ind_maxcomment)) - == NULL + if ((trypos = find_start_brace( + curbuf->b_ind_maxcomment)) == NULL || find_match(LOOKFOR_IF, trypos->lnum, - ind_maxparen, ind_maxcomment) == FAIL) + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment) == FAIL) break; } } @@ -8232,7 +8203,7 @@ get_c_indent() * enumerations/initializations. */ if (terminated == ',') { - if (ind_cpp_baseclass == 0) + if (curbuf->b_ind_cpp_baseclass == 0) break; lookfor = LOOKFOR_CPP_BASECLASS; @@ -8290,8 +8261,8 @@ get_c_indent() * If so: Ignore until the matching "do". */ /* XXX */ - else if (cin_iswhileofdo_end(terminated, ind_maxparen, - ind_maxcomment)) + else if (cin_iswhileofdo_end(terminated, curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) { /* * Found an unterminated line after a while ();, line up @@ -8315,7 +8286,7 @@ get_c_indent() lookfor = LOOKFOR_TERM; amount = get_indent(); /* XXX */ if (theline[0] == '{') - amount += ind_open_extra; + amount += curbuf->b_ind_open_extra; } ++whilelevel; } @@ -8408,8 +8379,9 @@ get_c_indent() term_again: l = ml_get_curline(); if (find_last_paren(l, '(', ')') - && (trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) + && (trypos = find_match_paren( + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) != NULL) { /* * Check if we are on a case label now. This is @@ -8436,21 +8408,22 @@ term_again: * stat; * } */ - iscase = (ind_keep_case_label && cin_iscase(l, FALSE)); + iscase = (curbuf->b_ind_keep_case_label + && cin_iscase(l, FALSE)); /* * Get indent and pointer to text for current line, * ignoring any jump label. */ amount = skip_label(curwin->w_cursor.lnum, - &l, ind_maxcomment); + &l, curbuf->b_ind_maxcomment); if (theline[0] == '{') - amount += ind_open_extra; - /* See remark above: "Only add ind_open_extra.." */ + amount += curbuf->b_ind_open_extra; + /* See remark above: "Only add b_ind_open_extra.." */ l = skipwhite(l); if (*l == '{') - amount -= ind_open_extra; + amount -= curbuf->b_ind_open_extra; lookfor = iscase ? LOOKFOR_ANY : LOOKFOR_TERM; /* @@ -8466,10 +8439,11 @@ term_again: && cin_iselse(l) && whilelevel == 0) { - if ((trypos = find_start_brace(ind_maxcomment)) - == NULL + if ((trypos = find_start_brace( + curbuf->b_ind_maxcomment)) == NULL || find_match(LOOKFOR_IF, trypos->lnum, - ind_maxparen, ind_maxcomment) == FAIL) + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment) == FAIL) break; continue; } @@ -8480,8 +8454,8 @@ term_again: */ l = ml_get_curline(); if (find_last_paren(l, '{', '}') - && (trypos = find_start_brace(ind_maxcomment)) - != NULL) /* XXX */ + && (trypos = find_start_brace( + curbuf->b_ind_maxcomment)) != NULL) /* XXX */ { curwin->w_cursor = *trypos; /* if not "else {" check for terminated again */ @@ -8500,11 +8474,11 @@ term_again: /* add extra indent for a comment */ if (cin_iscomment(theline)) - amount += ind_comment; + amount += curbuf->b_ind_comment; /* subtract extra left-shift for jump labels */ - if (ind_jump_label > 0 && original_line_islabel) - amount -= ind_jump_label; + if (curbuf->b_ind_jump_label > 0 && original_line_islabel) + amount -= curbuf->b_ind_jump_label; } /* @@ -8525,7 +8499,7 @@ term_again: if (theline[0] == '{') { - amount = ind_first_open; + amount = curbuf->b_ind_first_open; } /* @@ -8543,10 +8517,11 @@ term_again: && !cin_ends_in(theline, (char_u *)",", NULL) && cin_isfuncdecl(NULL, cur_curpos.lnum + 1, cur_curpos.lnum + 1, - ind_maxparen, ind_maxcomment) + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment) && !cin_isterminated(theline, FALSE, TRUE)) { - amount = ind_func_type; + amount = curbuf->b_ind_func_type; } else { @@ -8565,7 +8540,8 @@ term_again: /* * If we're in a comment now, skip to the start of the comment. */ /* XXX */ - if ((trypos = find_start_comment(ind_maxcomment)) != NULL) + if ((trypos = find_start_comment( + curbuf->b_ind_maxcomment)) != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; curwin->w_cursor.col = 0; @@ -8577,7 +8553,7 @@ term_again: * constructor initialization? */ /* XXX */ n = FALSE; - if (ind_cpp_baseclass != 0 && theline[0] != '{') + if (curbuf->b_ind_cpp_baseclass != 0 && theline[0] != '{') { n = cin_is_cpp_baseclass(&col); l = ml_get_curline(); @@ -8585,8 +8561,9 @@ term_again: if (n) { /* XXX */ - amount = get_baseclass_amount(col, ind_maxparen, - ind_maxcomment, ind_cpp_baseclass); + amount = get_baseclass_amount(col, curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment, + curbuf->b_ind_cpp_baseclass); break; } @@ -8617,8 +8594,9 @@ term_again: { /* take us back to opening paren */ if (find_last_paren(l, '(', ')') - && (trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) + && (trypos = find_match_paren( + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) != NULL) curwin->w_cursor = *trypos; /* For a line ending in ',' that is a continuation line go @@ -8650,7 +8628,8 @@ term_again: * not in a comment, put it the left margin. */ if (cin_isfuncdecl(NULL, cur_curpos.lnum, 0, - ind_maxparen, ind_maxcomment)) /* XXX */ + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) /* XXX */ break; l = ml_get_curline(); @@ -8699,9 +8678,10 @@ term_again: * parameters. */ if (cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0, - ind_maxparen, ind_maxcomment)) + curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) { - amount = ind_param; + amount = curbuf->b_ind_param; break; } @@ -8730,8 +8710,8 @@ term_again: */ find_last_paren(l, '(', ')'); - if ((trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) + if ((trypos = find_match_paren(curbuf->b_ind_maxparen, + curbuf->b_ind_maxcomment)) != NULL) curwin->w_cursor = *trypos; amount = get_indent(); /* XXX */ break; @@ -8739,7 +8719,7 @@ term_again: /* add extra indent for a comment */ if (cin_iscomment(theline)) - amount += ind_comment; + amount += curbuf->b_ind_comment; /* add extra indent if the previous line ended in a backslash: * "asdfasdf\ diff --git a/src/ops.c b/src/ops.c index 1f2e97eea1..7571dc5c9e 100644 --- a/src/ops.c +++ b/src/ops.c @@ -336,7 +336,7 @@ shift_line(left, round, amount, call_changed_bytes) { int count; int i, j; - int p_sw = (int)get_sw_value(); + int p_sw = (int)get_sw_value(curbuf); count = get_indent(); /* get current indent */ @@ -392,7 +392,7 @@ shift_block(oap, amount) int total; char_u *newp, *oldp; int oldcol = curwin->w_cursor.col; - int p_sw = (int)get_sw_value(); + int p_sw = (int)get_sw_value(curbuf); int p_ts = (int)curbuf->b_p_ts; struct block_def bd; int incr; @@ -4046,7 +4046,8 @@ preprocs_left() # endif # endif # ifdef FEAT_CINDENT - (curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE)) + (curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE) + && curbuf->b_ind_hash_comment == 0) # endif ; } diff --git a/src/option.c b/src/option.c index bf655560a4..a02d5c4916 100644 --- a/src/option.c +++ b/src/option.c @@ -5372,6 +5372,7 @@ check_buf_options(buf) #ifdef FEAT_CINDENT check_string_option(&buf->b_p_cink); check_string_option(&buf->b_p_cino); + parse_cino(buf); #endif #ifdef FEAT_AUTOCMD check_string_option(&buf->b_p_ft); @@ -6990,6 +6991,15 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, } #endif +#ifdef FEAT_CINDENT + /* 'cinoptions' */ + else if (gvarp == &p_cino) + { + /* TODO: recognize errors */ + parse_cino(curbuf); + } +#endif + /* Options that are a list of flags. */ else { @@ -8338,14 +8348,24 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags) curwin->w_p_fdc = 12; } } +#endif /* FEAT_FOLDING */ +#if defined(FEAT_FOLDING) || defined(FEAT_CINDENT) /* 'shiftwidth' or 'tabstop' */ else if (pp == &curbuf->b_p_sw || pp == &curbuf->b_p_ts) { +# ifdef FEAT_FOLDING if (foldmethodIsIndent(curwin)) foldUpdateAll(curwin); +# endif +# ifdef FEAT_CINDENT + /* When 'shiftwidth' changes, or it's zero and 'tabstop' changes: + * parse 'cinoptions'. */ + if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0) + parse_cino(curbuf); +# endif } -#endif /* FEAT_FOLDING */ +#endif #ifdef FEAT_MBYTE /* 'maxcombine' */ @@ -11729,9 +11749,10 @@ check_ff_value(p) * 'tabstop' value when 'shiftwidth' is zero. */ long -get_sw_value() +get_sw_value(buf) + buf_T *buf; { - return curbuf->b_p_sw ? curbuf->b_p_sw : curbuf->b_p_ts; + return buf->b_p_sw ? buf->b_p_sw : buf->b_p_ts; } /* @@ -11741,7 +11762,7 @@ get_sw_value() long get_sts_value() { - return curbuf->b_p_sts < 0 ? get_sw_value() : curbuf->b_p_sts; + return curbuf->b_p_sts < 0 ? get_sw_value(curbuf) : curbuf->b_p_sts; } /* diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index d6672e4948..7183bbd921 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -84,6 +84,7 @@ void do_c_expr_indent __ARGS((void)); int cin_islabel __ARGS((int ind_maxcomment)); int cin_iscase __ARGS((char_u *s, int strict)); int cin_isscopedecl __ARGS((char_u *s)); +void parse_cino __ARGS((buf_T *buf)); int get_c_indent __ARGS((void)); int get_expr_indent __ARGS((void)); int get_lisp_indent __ARGS((void)); diff --git a/src/proto/option.pro b/src/proto/option.pro index 853a342528..cd3afbf79b 100644 --- a/src/proto/option.pro +++ b/src/proto/option.pro @@ -59,7 +59,7 @@ int can_bs __ARGS((int what)); void save_file_ff __ARGS((buf_T *buf)); int file_ff_differs __ARGS((buf_T *buf, int ignore_empty)); int check_ff_value __ARGS((char_u *p)); -long get_sw_value __ARGS((void)); +long get_sw_value __ARGS((buf_T *buf)); long get_sts_value __ARGS((void)); void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit)); /* vim: set ft=c : */ diff --git a/src/structs.h b/src/structs.h index f74d218bd9..f076b2dd25 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1633,6 +1633,45 @@ struct file_buffer /* end of buffer options */ +#ifdef FEAT_CINDENT + /* values set from b_p_cino */ + int b_ind_level; + int b_ind_open_imag; + int b_ind_no_brace; + int b_ind_first_open; + int b_ind_open_extra; + int b_ind_close_extra; + int b_ind_open_left_imag; + int b_ind_jump_label; + int b_ind_case; + int b_ind_case_code; + int b_ind_case_break; + int b_ind_param; + int b_ind_func_type; + int b_ind_comment; + int b_ind_in_comment; + int b_ind_in_comment2; + int b_ind_cpp_baseclass; + int b_ind_continuation; + int b_ind_unclosed; + int b_ind_unclosed2; + int b_ind_unclosed_noignore; + int b_ind_unclosed_wrapped; + int b_ind_unclosed_whiteok; + int b_ind_matching_paren; + int b_ind_paren_prev; + int b_ind_maxparen; + int b_ind_maxcomment; + int b_ind_scopedecl; + int b_ind_scopedecl_code; + int b_ind_java; + int b_ind_js; + int b_ind_keep_case_label; + int b_ind_hash_comment; + int b_ind_cpp_namespace; + int b_ind_if_for_while; +#endif + linenr_T b_no_eol_lnum; /* non-zero lnum when last line of next binary * write should not have an end-of-line */ diff --git a/src/version.c b/src/version.c index a054f62c7b..fc4597d7b6 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 69, /**/ 68, /**/ From 2e451c0cd15a99b1f2c9e49d03b3d0f45dac7ced Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 5 Nov 2013 07:13:41 +0100 Subject: [PATCH 035/105] Added tag v7-4-069 for changeset 878ed73c7070 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ad6f8986b3..6b3e4bea3e 100644 --- a/.hgtags +++ b/.hgtags @@ -2791,3 +2791,4 @@ d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 38b948f534e4646bf879cb4d30151474e093d139 v7-4-066 86bf09a1b6d0275131caf7ffc51598608e7242de v7-4-067 efa40be729c2c94c1d8d0bf95000c4a7d2976dbc v7-4-068 +878ed73c70706d68bc7175343e4deb24b11963c2 v7-4-069 From 2a4d8b8b47ac22b6b8b4e76f71998c49a8b0ae8c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 5 Nov 2013 17:40:52 +0100 Subject: [PATCH 036/105] updated for version 7.4.070 Problem: Can't compile with tiny features. (Tony Mechelynck) Solution: Add #ifdef. --- src/buffer.c | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index 8973b42aae..ddbcbc4b50 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -213,7 +213,9 @@ open_buffer(read_stdin, eap, flags) if (curbuf->b_flags & BF_NEVERLOADED) { (void)buf_init_chartab(curbuf, FALSE); +#ifdef FEAT_CINDENT parse_cino(curbuf); +#endif } /* diff --git a/src/version.c b/src/version.c index fc4597d7b6..09f03b574a 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 70, /**/ 69, /**/ From d74bcf90e907ba0b0a5c6e35520cbfb33427b520 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 5 Nov 2013 17:40:53 +0100 Subject: [PATCH 037/105] Added tag v7-4-070 for changeset e6f3f66028d4 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6b3e4bea3e..eb82b0de72 100644 --- a/.hgtags +++ b/.hgtags @@ -2792,3 +2792,4 @@ d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 86bf09a1b6d0275131caf7ffc51598608e7242de v7-4-067 efa40be729c2c94c1d8d0bf95000c4a7d2976dbc v7-4-068 878ed73c70706d68bc7175343e4deb24b11963c2 v7-4-069 +e6f3f66028d448bb49ee2336cee60b13ced7cea9 v7-4-070 From 42930f83c63c5647b8a2b685e74a2f81ceb39452 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 6 Nov 2013 04:01:36 +0100 Subject: [PATCH 038/105] updated for version 7.4.071 Problem: Passing limits around too often. Solution: Use limits from buffer. --- src/edit.c | 5 +- src/misc1.c | 230 +++++++++++++++++--------------------------- src/proto/misc1.pro | 2 +- src/version.c | 2 + 4 files changed, 95 insertions(+), 144 deletions(-) diff --git a/src/edit.c b/src/edit.c index b4469e855a..d3c02085a8 100644 --- a/src/edit.c +++ b/src/edit.c @@ -7857,8 +7857,7 @@ in_cinkeys(keytyped, when, line_is_empty) if (try_match && keytyped == ':') { p = ml_get_curline(); - if (cin_iscase(p, FALSE) || cin_isscopedecl(p) - || cin_islabel(30)) + if (cin_iscase(p, FALSE) || cin_isscopedecl(p) || cin_islabel()) return TRUE; /* Need to get the line again after cin_islabel(). */ p = ml_get_curline(); @@ -7868,7 +7867,7 @@ in_cinkeys(keytyped, when, line_is_empty) { p[curwin->w_cursor.col - 1] = ' '; i = (cin_iscase(p, FALSE) || cin_isscopedecl(p) - || cin_islabel(30)); + || cin_islabel()); p = ml_get_curline(); p[curwin->w_cursor.col - 1] = ':'; if (i) diff --git a/src/misc1.c b/src/misc1.c index fa43657a47..b258d0bc93 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -5191,11 +5191,18 @@ FullName_save(fname, force) #if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL) static char_u *skip_string __ARGS((char_u *p)); +static pos_T *ind_find_start_comment __ARGS((void)); /* * Find the start of a comment, not knowing if we are in a comment right now. * Search starts at w_cursor.lnum and goes backwards. */ + static pos_T * +ind_find_start_comment() /* XXX */ +{ + return find_start_comment(curbuf->b_ind_maxcomment); +} + pos_T * find_start_comment(ind_maxcomment) /* XXX */ int ind_maxcomment; @@ -5313,7 +5320,7 @@ static int cin_islabel_skip __ARGS((char_u **)); static int cin_isdefault __ARGS((char_u *)); static char_u *after_label __ARGS((char_u *l)); static int get_indent_nolabel __ARGS((linenr_T lnum)); -static int skip_label __ARGS((linenr_T, char_u **pp, int ind_maxcomment)); +static int skip_label __ARGS((linenr_T, char_u **pp)); static int cin_first_id_amount __ARGS((void)); static int cin_get_equal_amount __ARGS((linenr_T lnum)); static int cin_ispreproc __ARGS((char_u *)); @@ -5322,24 +5329,24 @@ static int cin_iscomment __ARGS((char_u *)); static int cin_islinecomment __ARGS((char_u *)); static int cin_isterminated __ARGS((char_u *, int, int)); static int cin_isinit __ARGS((void)); -static int cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T, int, int)); +static int cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T)); static int cin_isif __ARGS((char_u *)); static int cin_iselse __ARGS((char_u *)); static int cin_isdo __ARGS((char_u *)); -static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int)); +static int cin_iswhileofdo __ARGS((char_u *, linenr_T)); static int cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset)); -static int cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment)); +static int cin_iswhileofdo_end __ARGS((int terminated)); static int cin_isbreak __ARGS((char_u *)); static int cin_is_cpp_baseclass __ARGS((colnr_T *col)); -static int get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass)); +static int get_baseclass_amount __ARGS((int col)); static int cin_ends_in __ARGS((char_u *, char_u *, char_u *)); static int cin_starts_with __ARGS((char_u *s, char *word)); static int cin_skip2pos __ARGS((pos_T *trypos)); -static pos_T *find_start_brace __ARGS((int)); -static pos_T *find_match_paren __ARGS((int, int)); -static int corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos)); +static pos_T *find_start_brace __ARGS((void)); +static pos_T *find_match_paren __ARGS((int)); +static int corr_ind_maxparen __ARGS((pos_T *startpos)); static int find_last_paren __ARGS((char_u *l, int start, int end)); -static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment)); +static int find_match __ARGS((int lookfor, linenr_T ourscope)); static int cin_is_cpp_namespace __ARGS((char_u *)); /* @@ -5444,8 +5451,7 @@ cin_islabel_skip(s) * Note: curwin->w_cursor must be where we are looking for the label. */ int -cin_islabel(ind_maxcomment) /* XXX */ - int ind_maxcomment; +cin_islabel() /* XXX */ { char_u *s; @@ -5479,7 +5485,7 @@ cin_islabel(ind_maxcomment) /* XXX */ * If we're in a comment now, skip to the start of the comment. */ curwin->w_cursor.col = 0; - if ((trypos = find_start_comment(ind_maxcomment)) != NULL) /* XXX */ + if ((trypos = ind_find_start_comment()) != NULL) /* XXX */ curwin->w_cursor = *trypos; line = ml_get_curline(); @@ -5725,10 +5731,9 @@ get_indent_nolabel(lnum) /* XXX */ * ^ */ static int -skip_label(lnum, pp, ind_maxcomment) +skip_label(lnum, pp) linenr_T lnum; char_u **pp; - int ind_maxcomment; { char_u *l; int amount; @@ -5738,8 +5743,7 @@ skip_label(lnum, pp, ind_maxcomment) curwin->w_cursor.lnum = lnum; l = ml_get_curline(); /* XXX */ - if (cin_iscase(l, FALSE) || cin_isscopedecl(l) - || cin_islabel(ind_maxcomment)) + if (cin_iscase(l, FALSE) || cin_isscopedecl(l) || cin_islabel()) { amount = get_indent_nolabel(lnum); l = after_label(ml_get_curline()); @@ -5983,12 +5987,10 @@ cin_isterminated(s, incl_open, incl_comma) * "min_lnum" is the line before which we will not be looking. */ static int -cin_isfuncdecl(sp, first_lnum, min_lnum, ind_maxparen, ind_maxcomment) +cin_isfuncdecl(sp, first_lnum, min_lnum) char_u **sp; linenr_T first_lnum; linenr_T min_lnum; - int ind_maxparen; - int ind_maxcomment; { char_u *s; linenr_T lnum = first_lnum; @@ -6002,7 +6004,7 @@ cin_isfuncdecl(sp, first_lnum, min_lnum, ind_maxparen, ind_maxcomment) s = *sp; if (find_last_paren(s, '(', ')') - && (trypos = find_match_paren(ind_maxparen, ind_maxcomment)) != NULL) + && (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) { lnum = trypos->lnum; if (lnum < min_lnum) @@ -6110,10 +6112,9 @@ cin_isdo(p) * ')' and ';'. The condition may be spread over several lines. */ static int -cin_iswhileofdo(p, lnum, ind_maxparen) /* XXX */ +cin_iswhileofdo(p, lnum) /* XXX */ char_u *p; linenr_T lnum; - int ind_maxparen; { pos_T cursor_save; pos_T *trypos; @@ -6133,7 +6134,8 @@ cin_iswhileofdo(p, lnum, ind_maxparen) /* XXX */ ++p; ++curwin->w_cursor.col; } - if ((trypos = findmatchlimit(NULL, 0, 0, ind_maxparen)) != NULL + if ((trypos = findmatchlimit(NULL, 0, 0, + curbuf->b_ind_maxparen)) != NULL && *cin_skipcomment(ml_get_pos(trypos) + 1) == ';') retval = TRUE; curwin->w_cursor = cursor_save; @@ -6196,10 +6198,8 @@ probablyFound: * Adjust the cursor to the line with "while". */ static int -cin_iswhileofdo_end(terminated, ind_maxparen, ind_maxcomment) +cin_iswhileofdo_end(terminated) int terminated; - int ind_maxparen; - int ind_maxcomment; { char_u *line; char_u *p; @@ -6223,7 +6223,7 @@ cin_iswhileofdo_end(terminated, ind_maxparen, ind_maxcomment) * before the matching '('. XXX */ i = (int)(p - line); curwin->w_cursor.col = i; - trypos = find_match_paren(ind_maxparen, ind_maxcomment); + trypos = find_match_paren(curbuf->b_ind_maxparen); if (trypos != NULL) { s = cin_skipcomment(ml_get(trypos->lnum)); @@ -6415,11 +6415,8 @@ cin_is_cpp_baseclass(col) } static int -get_baseclass_amount(col, ind_maxparen, ind_maxcomment, ind_cpp_baseclass) +get_baseclass_amount(col) int col; - int ind_maxparen; - int ind_maxcomment; - int ind_cpp_baseclass; { int amount; colnr_T vcol; @@ -6429,11 +6426,10 @@ get_baseclass_amount(col, ind_maxparen, ind_maxcomment, ind_cpp_baseclass) { amount = get_indent(); if (find_last_paren(ml_get_curline(), '(', ')') - && (trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) + && (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) amount = get_indent_lnum(trypos->lnum); /* XXX */ if (!cin_ends_in(ml_get_curline(), (char_u *)",", NULL)) - amount += ind_cpp_baseclass; + amount += curbuf->b_ind_cpp_baseclass; } else { @@ -6441,8 +6437,8 @@ get_baseclass_amount(col, ind_maxparen, ind_maxcomment, ind_cpp_baseclass) getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); amount = (int)vcol; } - if (amount < ind_cpp_baseclass) - amount = ind_cpp_baseclass; + if (amount < curbuf->b_ind_cpp_baseclass) + amount = curbuf->b_ind_cpp_baseclass; return amount; } @@ -6526,8 +6522,7 @@ cin_skip2pos(trypos) /* } */ static pos_T * -find_start_brace(ind_maxcomment) /* XXX */ - int ind_maxcomment; +find_start_brace() /* XXX */ { pos_T cursor_save; pos_T *trypos; @@ -6543,7 +6538,7 @@ find_start_brace(ind_maxcomment) /* XXX */ pos = NULL; /* ignore the { if it's in a // or / * * / comment */ if ((colnr_T)cin_skip2pos(trypos) == trypos->col - && (pos = find_start_comment(ind_maxcomment)) == NULL) /* XXX */ + && (pos = ind_find_start_comment()) == NULL) /* XXX */ break; if (pos != NULL) curwin->w_cursor.lnum = pos->lnum; @@ -6557,9 +6552,8 @@ find_start_brace(ind_maxcomment) /* XXX */ * Return NULL if no match found. */ static pos_T * -find_match_paren(ind_maxparen, ind_maxcomment) /* XXX */ +find_match_paren(ind_maxparen) /* XXX */ int ind_maxparen; - int ind_maxcomment; { pos_T cursor_save; pos_T *trypos; @@ -6576,7 +6570,7 @@ find_match_paren(ind_maxparen, ind_maxcomment) /* XXX */ pos_copy = *trypos; /* copy trypos, findmatch will change it */ trypos = &pos_copy; curwin->w_cursor = *trypos; - if (find_start_comment(ind_maxcomment) != NULL) /* XXX */ + if (ind_find_start_comment() != NULL) /* XXX */ trypos = NULL; } } @@ -6591,15 +6585,14 @@ find_match_paren(ind_maxparen, ind_maxcomment) /* XXX */ * looking a few lines further. */ static int -corr_ind_maxparen(ind_maxparen, startpos) - int ind_maxparen; +corr_ind_maxparen(startpos) pos_T *startpos; { long n = (long)startpos->lnum - (long)curwin->w_cursor.lnum; - if (n > 0 && n < ind_maxparen / 2) - return ind_maxparen - (int)n; - return ind_maxparen; + if (n > 0 && n < curbuf->b_ind_maxparen / 2) + return curbuf->b_ind_maxparen - (int)n; + return curbuf->b_ind_maxparen; } /* @@ -6937,7 +6930,7 @@ get_c_indent() curwin->w_cursor.col = 0; - original_line_islabel = cin_islabel(curbuf->b_ind_maxcomment); /* XXX */ + original_line_islabel = cin_islabel(); /* XXX */ /* * #defines and so on always go at the left when included in 'cinkeys'. @@ -6973,7 +6966,7 @@ get_c_indent() * comment, try using the 'comments' option. */ else if (!cin_iscomment(theline) - && (trypos = find_start_comment(curbuf->b_ind_maxcomment)) != NULL) + && (trypos = ind_find_start_comment()) != NULL) /* XXX */ { int lead_start_len = 2; @@ -7126,11 +7119,9 @@ get_c_indent() /* * Are we inside parentheses or braces? */ /* XXX */ - else if (((trypos = find_match_paren(curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) != NULL + else if (((trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL && curbuf->b_ind_java == 0) - || (tryposBrace = - find_start_brace(curbuf->b_ind_maxcomment)) != NULL + || (tryposBrace = find_start_brace()) != NULL || trypos != NULL) { if (trypos != NULL && tryposBrace != NULL) @@ -7170,8 +7161,7 @@ get_c_indent() curwin->w_cursor.lnum = lnum; /* Skip a comment. XXX */ - if ((trypos = find_start_comment(curbuf->b_ind_maxcomment)) - != NULL) + if ((trypos = ind_find_start_comment()) != NULL) { lnum = trypos->lnum + 1; continue; @@ -7179,8 +7169,7 @@ get_c_indent() /* XXX */ if ((trypos = find_match_paren( - corr_ind_maxparen(curbuf->b_ind_maxparen, &cur_curpos), - curbuf->b_ind_maxcomment)) != NULL + corr_ind_maxparen(&cur_curpos))) != NULL && trypos->lnum == our_paren_pos.lnum && trypos->col == our_paren_pos.col) { @@ -7223,8 +7212,7 @@ get_c_indent() curwin->w_cursor.lnum = outermost.lnum; curwin->w_cursor.col = outermost.col; - trypos = find_match_paren(curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment); + trypos = find_match_paren(curbuf->b_ind_maxparen); } while (trypos && trypos->lnum == outermost.lnum); curwin->w_cursor = cursor_save; @@ -7235,8 +7223,7 @@ get_c_indent() cin_is_if_for_while_before_offset(line, &outermost.col); } - amount = skip_label(our_paren_pos.lnum, &look, - curbuf->b_ind_maxcomment); + amount = skip_label(our_paren_pos.lnum, &look); look = skipwhite(look); if (*look == '(') { @@ -7366,8 +7353,7 @@ get_c_indent() { curwin->w_cursor.lnum = our_paren_pos.lnum; curwin->w_cursor.col = col; - if (find_match_paren(curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment) != NULL) + if (find_match_paren(curbuf->b_ind_maxparen) != NULL) amount += curbuf->b_ind_unclosed2; else { @@ -7435,8 +7421,8 @@ get_c_indent() */ lnum = ourscope; if (find_last_paren(start, '(', ')') - && (trypos = find_match_paren(curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) != NULL) + && (trypos = find_match_paren(curbuf->b_ind_maxparen)) + != NULL) lnum = trypos->lnum; /* @@ -7449,7 +7435,7 @@ get_c_indent() && cin_iscase(skipwhite(ml_get_curline()), FALSE))) amount = get_indent(); else - amount = skip_label(lnum, &l, curbuf->b_ind_maxcomment); + amount = skip_label(lnum, &l); start_brace = BRACE_AT_END; } @@ -7478,14 +7464,12 @@ get_c_indent() lookfor = LOOKFOR_INITIAL; if (cin_iselse(theline)) lookfor = LOOKFOR_IF; - else if (cin_iswhileofdo(theline, cur_curpos.lnum, - curbuf->b_ind_maxparen)) /* XXX */ + else if (cin_iswhileofdo(theline, cur_curpos.lnum)) /* XXX */ lookfor = LOOKFOR_DO; if (lookfor != LOOKFOR_INITIAL) { curwin->w_cursor.lnum = cur_curpos.lnum; - if (find_match(lookfor, ourscope, curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment) == OK) + if (find_match(lookfor, ourscope) == OK) { amount = get_indent(); /* XXX */ goto theend; @@ -7611,7 +7595,7 @@ get_c_indent() * If we're in a comment now, skip to the start of the * comment. */ - trypos = find_start_comment(curbuf->b_ind_maxcomment); + trypos = ind_find_start_comment(); if (trypos != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; @@ -7636,9 +7620,7 @@ get_c_indent() * (it's a variable declaration). */ if (start_brace != BRACE_IN_COL0 - || !cin_isfuncdecl(&l, curwin->w_cursor.lnum, - 0, curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) + || !cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0)) { /* if the line is terminated with another ',' * it is a continued variable initialization. @@ -7670,12 +7652,10 @@ get_c_indent() trypos = NULL; if (find_last_paren(l, '(', ')')) trypos = find_match_paren( - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment); + curbuf->b_ind_maxparen); if (trypos == NULL && find_last_paren(l, '{', '}')) - trypos = find_start_brace( - curbuf->b_ind_maxcomment); + trypos = find_start_brace(); if (trypos != NULL) { @@ -7733,8 +7713,7 @@ get_c_indent() /* If we're in a comment now, skip to the start of * the comment. */ - trypos = find_start_comment( - curbuf->b_ind_maxcomment); + trypos = ind_find_start_comment(); if (trypos != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; @@ -7764,8 +7743,7 @@ get_c_indent() /* * If we're in a comment now, skip to the start of the comment. */ /* XXX */ - if ((trypos = find_start_comment(curbuf->b_ind_maxcomment)) - != NULL) + if ((trypos = ind_find_start_comment()) != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; curwin->w_cursor.col = 0; @@ -7819,8 +7797,7 @@ get_c_indent() * Check that this case label is not for another * switch() */ /* XXX */ - if ((trypos = find_start_brace( - curbuf->b_ind_maxcomment)) == NULL + if ((trypos = find_start_brace()) == NULL || trypos->lnum == ourscope) { amount = get_indent(); /* XXX */ @@ -7894,8 +7871,8 @@ get_c_indent() */ if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL) { - if (find_last_paren(l, '{', '}') && (trypos = - find_start_brace(curbuf->b_ind_maxcomment)) != NULL) + if (find_last_paren(l, '{', '}') + && (trypos = find_start_brace()) != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; curwin->w_cursor.col = 0; @@ -7906,7 +7883,7 @@ get_c_indent() /* * Ignore jump labels with nothing after them. */ - if (!curbuf->b_ind_js && cin_islabel(curbuf->b_ind_maxcomment)) + if (!curbuf->b_ind_js && cin_islabel()) { l = after_label(ml_get_curline()); if (l == NULL || cin_nocode(l)) @@ -7952,10 +7929,7 @@ get_c_indent() } else /* XXX */ - amount = get_baseclass_amount(col, - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment, - curbuf->b_ind_cpp_baseclass); + amount = get_baseclass_amount(col); break; } else if (lookfor == LOOKFOR_CPP_BASECLASS) @@ -7997,9 +7971,7 @@ get_c_indent() * matching it will take us back to the start of the line. */ (void)find_last_paren(l, '(', ')'); - trypos = find_match_paren( - corr_ind_maxparen(curbuf->b_ind_maxparen, - &cur_curpos), curbuf->b_ind_maxcomment); + trypos = find_match_paren(corr_ind_maxparen(&cur_curpos)); /* * If we are looking for ',', we also look for matching @@ -8007,7 +7979,7 @@ get_c_indent() */ if (trypos == NULL && terminated == ',' && find_last_paren(l, '{', '}')) - trypos = find_start_brace(curbuf->b_ind_maxcomment); + trypos = find_start_brace(); if (trypos != NULL) { @@ -8051,8 +8023,7 @@ get_c_indent() * ignoring any jump label. XXX */ if (!curbuf->b_ind_js) - cur_amount = skip_label(curwin->w_cursor.lnum, - &l, curbuf->b_ind_maxcomment); + cur_amount = skip_label(curwin->w_cursor.lnum, &l); else cur_amount = get_indent(); /* @@ -8162,11 +8133,9 @@ get_c_indent() curwin->w_cursor.col = (colnr_T)(l - ml_get_curline()) + 1; - if ((trypos = find_start_brace( - curbuf->b_ind_maxcomment)) == NULL - || find_match(LOOKFOR_IF, trypos->lnum, - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment) == FAIL) + if ((trypos = find_start_brace()) == NULL + || find_match(LOOKFOR_IF, trypos->lnum) + == FAIL) break; } } @@ -8261,8 +8230,7 @@ get_c_indent() * If so: Ignore until the matching "do". */ /* XXX */ - else if (cin_iswhileofdo_end(terminated, curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) + else if (cin_iswhileofdo_end(terminated)) { /* * Found an unterminated line after a while ();, line up @@ -8380,8 +8348,7 @@ term_again: l = ml_get_curline(); if (find_last_paren(l, '(', ')') && (trypos = find_match_paren( - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) != NULL) + curbuf->b_ind_maxparen)) != NULL) { /* * Check if we are on a case label now. This is @@ -8415,8 +8382,7 @@ term_again: * Get indent and pointer to text for current line, * ignoring any jump label. */ - amount = skip_label(curwin->w_cursor.lnum, - &l, curbuf->b_ind_maxcomment); + amount = skip_label(curwin->w_cursor.lnum, &l); if (theline[0] == '{') amount += curbuf->b_ind_open_extra; @@ -8439,11 +8405,9 @@ term_again: && cin_iselse(l) && whilelevel == 0) { - if ((trypos = find_start_brace( - curbuf->b_ind_maxcomment)) == NULL - || find_match(LOOKFOR_IF, trypos->lnum, - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment) == FAIL) + if ((trypos = find_start_brace()) == NULL + || find_match(LOOKFOR_IF, trypos->lnum) + == FAIL) break; continue; } @@ -8453,9 +8417,8 @@ term_again: * that block. */ l = ml_get_curline(); - if (find_last_paren(l, '{', '}') - && (trypos = find_start_brace( - curbuf->b_ind_maxcomment)) != NULL) /* XXX */ + if (find_last_paren(l, '{', '}') /* XXX */ + && (trypos = find_start_brace()) != NULL) { curwin->w_cursor = *trypos; /* if not "else {" check for terminated again */ @@ -8516,9 +8479,7 @@ term_again: && !cin_ends_in(theline, (char_u *)":", NULL) && !cin_ends_in(theline, (char_u *)",", NULL) && cin_isfuncdecl(NULL, cur_curpos.lnum + 1, - cur_curpos.lnum + 1, - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment) + cur_curpos.lnum + 1) && !cin_isterminated(theline, FALSE, TRUE)) { amount = curbuf->b_ind_func_type; @@ -8540,8 +8501,7 @@ term_again: /* * If we're in a comment now, skip to the start of the comment. */ /* XXX */ - if ((trypos = find_start_comment( - curbuf->b_ind_maxcomment)) != NULL) + if ((trypos = ind_find_start_comment()) != NULL) { curwin->w_cursor.lnum = trypos->lnum + 1; curwin->w_cursor.col = 0; @@ -8561,9 +8521,7 @@ term_again: if (n) { /* XXX */ - amount = get_baseclass_amount(col, curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment, - curbuf->b_ind_cpp_baseclass); + amount = get_baseclass_amount(col); break; } @@ -8595,8 +8553,7 @@ term_again: /* take us back to opening paren */ if (find_last_paren(l, '(', ')') && (trypos = find_match_paren( - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) != NULL) + curbuf->b_ind_maxparen)) != NULL) curwin->w_cursor = *trypos; /* For a line ending in ',' that is a continuation line go @@ -8627,9 +8584,7 @@ term_again: * If the line looks like a function declaration, and we're * not in a comment, put it the left margin. */ - if (cin_isfuncdecl(NULL, cur_curpos.lnum, 0, - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) /* XXX */ + if (cin_isfuncdecl(NULL, cur_curpos.lnum, 0)) /* XXX */ break; l = ml_get_curline(); @@ -8677,9 +8632,7 @@ term_again: * line (and the ones that follow) needs to be indented as * parameters. */ - if (cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0, - curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) + if (cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0)) { amount = curbuf->b_ind_param; break; @@ -8710,8 +8663,7 @@ term_again: */ find_last_paren(l, '(', ')'); - if ((trypos = find_match_paren(curbuf->b_ind_maxparen, - curbuf->b_ind_maxcomment)) != NULL) + if ((trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) curwin->w_cursor = *trypos; amount = get_indent(); /* XXX */ break; @@ -8754,11 +8706,9 @@ theend: } static int -find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment) +find_match(lookfor, ourscope) int lookfor; linenr_T ourscope; - int ind_maxparen; - int ind_maxcomment; { char_u *look; pos_T *theirscope; @@ -8788,13 +8738,13 @@ find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment) if (cin_iselse(look) || cin_isif(look) || cin_isdo(look) /* XXX */ - || cin_iswhileofdo(look, curwin->w_cursor.lnum, ind_maxparen)) + || cin_iswhileofdo(look, curwin->w_cursor.lnum)) { /* * if we've gone outside the braces entirely, * we must be out of scope... */ - theirscope = find_start_brace(ind_maxcomment); /* XXX */ + theirscope = find_start_brace(); /* XXX */ if (theirscope == NULL) break; @@ -8832,7 +8782,7 @@ find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment) * if it was a "while" then we need to go back to * another "do", so increment whilelevel. XXX */ - if (cin_iswhileofdo(look, curwin->w_cursor.lnum, ind_maxparen)) + if (cin_iswhileofdo(look, curwin->w_cursor.lnum)) { ++whilelevel; continue; diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index 7183bbd921..394880a1ee 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -81,7 +81,7 @@ void add_pathsep __ARGS((char_u *p)); char_u *FullName_save __ARGS((char_u *fname, int force)); pos_T *find_start_comment __ARGS((int ind_maxcomment)); void do_c_expr_indent __ARGS((void)); -int cin_islabel __ARGS((int ind_maxcomment)); +int cin_islabel __ARGS((void)); int cin_iscase __ARGS((char_u *s, int strict)); int cin_isscopedecl __ARGS((char_u *s)); void parse_cino __ARGS((buf_T *buf)); diff --git a/src/version.c b/src/version.c index 09f03b574a..69e8fbd6c2 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 71, /**/ 70, /**/ From 1729763f753396bf11cf563b0356b4a75955ffec Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 6 Nov 2013 04:01:36 +0100 Subject: [PATCH 039/105] Added tag v7-4-071 for changeset faf7e86203b5 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index eb82b0de72..696b2c3d68 100644 --- a/.hgtags +++ b/.hgtags @@ -2793,3 +2793,4 @@ d062239654688774d38e60ac42cec8ae1fd0f14b v7-4-064 efa40be729c2c94c1d8d0bf95000c4a7d2976dbc v7-4-068 878ed73c70706d68bc7175343e4deb24b11963c2 v7-4-069 e6f3f66028d448bb49ee2336cee60b13ced7cea9 v7-4-070 +faf7e86203b5d5c98bdd30dd92524e5062b2412a v7-4-071 From 3a2edbb016fec993d72e5135fd44ad317d99f99c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 6 Nov 2013 04:04:33 +0100 Subject: [PATCH 040/105] updated for version 7.4.072 Problem: Crash when using Insert mode completion. Solution: Avoid going past the end of pum_array. (idea by Fransisco Lopes) --- src/popupmnu.c | 8 ++++---- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/popupmnu.c b/src/popupmnu.c index 44ed878045..8ff0711cc5 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -282,6 +282,10 @@ pum_redraw() int round; int n; + /* Never display more than we have */ + if (pum_first > pum_size - pum_height) + pum_first = pum_size - pum_height; + if (pum_scrollbar) { thumb_heigth = pum_height * pum_height / pum_size; @@ -672,10 +676,6 @@ pum_set_selected(n, repeat) #endif } - /* Never display more than we have */ - if (pum_first > pum_size - pum_height) - pum_first = pum_size - pum_height; - if (!resized) pum_redraw(); diff --git a/src/version.c b/src/version.c index 69e8fbd6c2..4276558b5f 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 72, /**/ 71, /**/ From c611e9e0cfe17953cf025044c73fef608b146f32 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 6 Nov 2013 04:04:33 +0100 Subject: [PATCH 041/105] Added tag v7-4-072 for changeset d563839a9be0 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 696b2c3d68..71709f7dcc 100644 --- a/.hgtags +++ b/.hgtags @@ -2794,3 +2794,4 @@ efa40be729c2c94c1d8d0bf95000c4a7d2976dbc v7-4-068 878ed73c70706d68bc7175343e4deb24b11963c2 v7-4-069 e6f3f66028d448bb49ee2336cee60b13ced7cea9 v7-4-070 faf7e86203b5d5c98bdd30dd92524e5062b2412a v7-4-071 +d563839a9be0be6e85d93e366b4f7ffe705d8e3b v7-4-072 From 19662400a631f62331072baa3e35c07cd6e2c510 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 6 Nov 2013 05:26:15 +0100 Subject: [PATCH 042/105] updated for version 7.4.073 Problem: Setting undolevels for one buffer changes undo in another. Solution: Make 'undolevels' a global-local option. (Christian Brabandt) --- runtime/doc/options.txt | 7 ++++--- src/buffer.c | 1 + src/option.c | 31 +++++++++++++++++++++++++++---- src/option.h | 4 ++++ src/structs.h | 1 + src/undo.c | 27 ++++++++++++++++++++------- src/version.c | 2 ++ 7 files changed, 59 insertions(+), 14 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 0688fcc23b..8d8c954f7a 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -7594,7 +7594,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'undolevels'* *'ul'* 'undolevels' 'ul' number (default 100, 1000 for Unix, VMS, Win32 and OS/2) - global + global or local to buffer |global-local| {not in Vi} Maximum number of changes that can be undone. Since undo information is kept in memory, higher numbers will cause more memory to be used @@ -7605,8 +7605,9 @@ A jump table for the options with a short description can be found at |Q_op|. < But you can also get Vi compatibility by including the 'u' flag in 'cpoptions', and still be able to use CTRL-R to repeat undo. Also see |undo-two-ways|. - Set to a negative number for no undo at all: > - set ul=-1 + Set to -1 for no undo at all. You might want to do this only for the + current buffer: > + setlocal ul=-1 < This helps when you run out of memory for a single change. Also see |clear-undo|. diff --git a/src/buffer.c b/src/buffer.c index ddbcbc4b50..9dc7378f56 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1949,6 +1949,7 @@ free_buf_options(buf, free_p_ff) clear_string_option(&buf->b_p_qe); #endif buf->b_p_ar = -1; + buf->b_p_ul = NO_LOCAL_UNDOLEVEL; } /* diff --git a/src/option.c b/src/option.c index a02d5c4916..2b94d8525b 100644 --- a/src/option.c +++ b/src/option.c @@ -234,6 +234,7 @@ #ifdef FEAT_STL_OPT # define PV_STL OPT_BOTH(OPT_WIN(WV_STL)) #endif +#define PV_UL OPT_BOTH(OPT_BUF(BV_UL)) #ifdef FEAT_WINDOWS # define PV_WFH OPT_WIN(WV_WFH) #endif @@ -2683,7 +2684,7 @@ static struct vimoption #endif {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, {"undolevels", "ul", P_NUM|P_VI_DEF, - (char_u *)&p_ul, PV_NONE, + (char_u *)&p_ul, PV_UL, { #if defined(UNIX) || defined(WIN3264) || defined(OS2) || defined(VMS) (char_u *)1000L, @@ -3313,6 +3314,7 @@ set_init_1() curbuf->b_p_initialized = TRUE; curbuf->b_p_ar = -1; /* no local 'autoread' value */ + curbuf->b_p_ul = NO_LOCAL_UNDOLEVEL; check_buf_options(curbuf); check_win_options(curwin); check_options(); @@ -4512,8 +4514,16 @@ do_set(arg, opt_flags) ((flags & P_VI_DEF) || cp_val) ? VI_DEFAULT : VIM_DEFAULT]; else if (nextchar == '<') - value = *(long *)get_varp_scope(&(options[opt_idx]), - OPT_GLOBAL); + { + /* For 'undolevels' NO_LOCAL_UNDOLEVEL means to + * use the global value. */ + if ((long *)varp == &curbuf->b_p_ul + && opt_flags == OPT_LOCAL) + value = NO_LOCAL_UNDOLEVEL; + else + value = *(long *)get_varp_scope( + &(options[opt_idx]), OPT_GLOBAL); + } else if (((long *)varp == &p_wc || (long *)varp == &p_wcm) && (*arg == '<' @@ -8487,6 +8497,13 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags) u_sync(TRUE); p_ul = value; } + else if (pp == &curbuf->b_p_ul) + { + /* use the old value, otherwise u_sync() may not work properly */ + curbuf->b_p_ul = old_value; + u_sync(TRUE); + curbuf->b_p_ul = value; + } #ifdef FEAT_LINEBREAK /* 'numberwidth' must be positive */ @@ -9720,7 +9737,6 @@ comp_col() /* * Unset local option value, similar to ":set opt<". */ - void unset_global_local_option(name, from) char_u *name; @@ -9793,6 +9809,9 @@ unset_global_local_option(name, from) clear_string_option(&((win_T *)from)->w_p_stl); break; #endif + case PV_UL: + buf->b_p_ul = NO_LOCAL_UNDOLEVEL; + break; } } @@ -9841,6 +9860,7 @@ get_varp_scope(p, opt_flags) #ifdef FEAT_STL_OPT case PV_STL: return (char_u *)&(curwin->w_p_stl); #endif + case PV_UL: return (char_u *)&(curbuf->b_p_ul); } return NULL; /* "cannot happen" */ } @@ -9905,6 +9925,8 @@ get_varp(p) case PV_STL: return *curwin->w_p_stl != NUL ? (char_u *)&(curwin->w_p_stl) : p->var; #endif + case PV_UL: return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL + ? (char_u *)&(curbuf->b_p_ul) : p->var; #ifdef FEAT_ARABIC case PV_ARAB: return (char_u *)&(curwin->w_p_arab); @@ -10445,6 +10467,7 @@ buf_copy_options(buf, flags) /* options that are normally global but also have a local value * are not copied, start using the global value */ buf->b_p_ar = -1; + buf->b_p_ul = NO_LOCAL_UNDOLEVEL; #ifdef FEAT_QUICKFIX buf->b_p_gp = empty_option; buf->b_p_mp = empty_option; diff --git a/src/option.h b/src/option.h index 167b5629e6..737cbca36b 100644 --- a/src/option.h +++ b/src/option.h @@ -1031,6 +1031,7 @@ enum , BV_TW , BV_TX , BV_UDF + , BV_UL , BV_WM , BV_COUNT /* must be the last one */ }; @@ -1109,3 +1110,6 @@ enum , WV_WRAP , WV_COUNT /* must be the last one */ }; + +/* Value for b_p_ul indicating the global value must be used. */ +#define NO_LOCAL_UNDOLEVEL -123456 diff --git a/src/structs.h b/src/structs.h index f076b2dd25..f3f3aaa89b 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1627,6 +1627,7 @@ struct file_buffer char_u *b_p_dict; /* 'dictionary' local value */ char_u *b_p_tsr; /* 'thesaurus' local value */ #endif + long b_p_ul; /* 'undolevels' local value */ #ifdef FEAT_PERSISTENT_UNDO int b_p_udf; /* 'undofile' */ #endif diff --git a/src/undo.c b/src/undo.c index eb99294aa9..8646b4616b 100644 --- a/src/undo.c +++ b/src/undo.c @@ -83,6 +83,7 @@ #include "vim.h" +static long get_undolevel __ARGS((void)); static void u_unch_branch __ARGS((u_header_T *uhp)); static u_entry_T *u_get_headentry __ARGS((void)); static void u_getbot __ARGS((void)); @@ -335,6 +336,17 @@ undo_allowed() return TRUE; } +/* + * Get the undolevle value for the current buffer. + */ + static long +get_undolevel() +{ + if (curbuf->b_p_ul == NO_LOCAL_UNDOLEVEL) + return p_ul; + return curbuf->b_p_ul; +} + /* * Common code for various ways to save text before a change. * "top" is the line above the first changed line. @@ -419,7 +431,7 @@ u_savecommon(top, bot, newbot, reload) curbuf->b_new_change = TRUE; #endif - if (p_ul >= 0) + if (get_undolevel() >= 0) { /* * Make a new header entry. Do this first so that we don't mess @@ -449,7 +461,8 @@ u_savecommon(top, bot, newbot, reload) /* * free headers to keep the size right */ - while (curbuf->b_u_numhead > p_ul && curbuf->b_u_oldhead != NULL) + while (curbuf->b_u_numhead > get_undolevel() + && curbuf->b_u_oldhead != NULL) { u_header_T *uhfree = curbuf->b_u_oldhead; @@ -530,7 +543,7 @@ u_savecommon(top, bot, newbot, reload) } else { - if (p_ul < 0) /* no undo at all */ + if (get_undolevel() < 0) /* no undo at all */ return OK; /* @@ -1972,7 +1985,7 @@ u_doit(startcount) { if (curbuf->b_u_curhead == NULL) /* first undo */ curbuf->b_u_curhead = curbuf->b_u_newhead; - else if (p_ul > 0) /* multi level undo */ + else if (get_undolevel() > 0) /* multi level undo */ /* get next undo */ curbuf->b_u_curhead = curbuf->b_u_curhead->uh_next.ptr; /* nothing to undo */ @@ -1993,7 +2006,7 @@ u_doit(startcount) } else { - if (curbuf->b_u_curhead == NULL || p_ul <= 0) + if (curbuf->b_u_curhead == NULL || get_undolevel() <= 0) { beep_flush(); /* nothing to redo */ if (count == startcount - 1) @@ -2751,7 +2764,7 @@ u_sync(force) if (im_is_preediting()) return; /* XIM is busy, don't break an undo sequence */ #endif - if (p_ul < 0) + if (get_undolevel() < 0) curbuf->b_u_synced = TRUE; /* no entries, nothing to do */ else { @@ -2911,7 +2924,7 @@ ex_undojoin(eap) } if (!curbuf->b_u_synced) return; /* already unsynced */ - if (p_ul < 0) + if (get_undolevel() < 0) return; /* no entries, nothing to do */ else { diff --git a/src/version.c b/src/version.c index 4276558b5f..bbc36d6165 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 73, /**/ 72, /**/ From 0ec81af00855adaf0f910634be965767f5c8e949 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 6 Nov 2013 05:26:16 +0100 Subject: [PATCH 043/105] Added tag v7-4-073 for changeset d0595545e98a --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 71709f7dcc..b764862f39 100644 --- a/.hgtags +++ b/.hgtags @@ -2795,3 +2795,4 @@ efa40be729c2c94c1d8d0bf95000c4a7d2976dbc v7-4-068 e6f3f66028d448bb49ee2336cee60b13ced7cea9 v7-4-070 faf7e86203b5d5c98bdd30dd92524e5062b2412a v7-4-071 d563839a9be0be6e85d93e366b4f7ffe705d8e3b v7-4-072 +d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 From a97ab8599fffc051d96af49436bc9b31d2740bbb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 03:04:11 +0100 Subject: [PATCH 044/105] updated for version 7.4.074 Problem: When undo'ing all changes and creating a new change the undo structure is incorrect. (Christian Brabandt) Solution: When deleting the branch starting at the old header, delete the whole branch, not just the first entry. --- src/undo.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/undo.c b/src/undo.c index 8646b4616b..c16f2afa75 100644 --- a/src/undo.c +++ b/src/undo.c @@ -3121,7 +3121,8 @@ u_freebranch(buf, uhp, uhpp) * all the pointers. */ if (uhp == buf->b_u_oldhead) { - u_freeheader(buf, uhp, uhpp); + while (buf->b_u_oldhead != NULL) + u_freeheader(buf, buf->b_u_oldhead, uhpp); return; } diff --git a/src/version.c b/src/version.c index bbc36d6165..60f9bf1b97 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 74, /**/ 73, /**/ From 1991245279e5af372d1e4023496c9e8b663afeac Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 03:04:12 +0100 Subject: [PATCH 045/105] Added tag v7-4-074 for changeset 9818311eeca0 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index b764862f39..36285241e7 100644 --- a/.hgtags +++ b/.hgtags @@ -2796,3 +2796,4 @@ e6f3f66028d448bb49ee2336cee60b13ced7cea9 v7-4-070 faf7e86203b5d5c98bdd30dd92524e5062b2412a v7-4-071 d563839a9be0be6e85d93e366b4f7ffe705d8e3b v7-4-072 d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 +9818311eeca0d76641879e95143f314e7295cc26 v7-4-074 From bc5dd8b2698fbbb6ac0f87299b4e579b3c3f17bb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 03:26:06 +0100 Subject: [PATCH 046/105] updated for version 7.4.075 Problem: Locally setting 'undolevels' is not tested. Solution: Add a test. (Christian Brabandt) --- src/Makefile | 3 ++- src/testdir/Make_amiga.mak | 3 ++- src/testdir/Make_dos.mak | 3 ++- src/testdir/Make_ming.mak | 3 ++- src/testdir/Make_os2.mak | 3 ++- src/testdir/Make_vms.mms | 5 +++-- src/testdir/Makefile | 2 +- src/testdir/test100.in | 42 ++++++++++++++++++++++++++++++++++++++ src/testdir/test100.ok | 41 +++++++++++++++++++++++++++++++++++++ src/version.c | 2 ++ 10 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 src/testdir/test100.in create mode 100644 src/testdir/test100.ok diff --git a/src/Makefile b/src/Makefile index c83037869b..bceb65c8e5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1882,7 +1882,8 @@ test1 test2 test3 test4 test5 test6 test7 test8 test9 \ test60 test61 test62 test63 test64 test65 test66 test67 test68 test69 \ test70 test71 test72 test73 test74 test75 test76 test77 test78 test79 \ test80 test81 test82 test83 test84 test85 test86 test87 test88 test89 \ - test90 test91 test92 test93 test94 test95 test96 test97 test98 test99: + test90 test91 test92 test93 test94 test95 test96 test97 test98 test99 \ + test100 test101 test102 test103 test104 test105 test106 test107: cd testdir; rm $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) testclean: diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index ce7dc3085f..81633e7ca3 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -34,7 +34,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out + test99.out test100.out .SUFFIXES: .in .out @@ -150,3 +150,4 @@ test96.out: test96.in test97.out: test97.in test98.out: test98.in test99.out: test99.in +test100.out: test100.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index d1551983ef..f89d99be73 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -32,7 +32,8 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test79.out test80.out test81.out test82.out test83.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out test98.out test99.out + test94.out test95.out test96.out test98.out test99.out \ + test100.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index 380594c119..eb0c469df2 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -52,7 +52,8 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test79.out test80.out test81.out test82.out test83.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out test98.out test99.out + test94.out test95.out test96.out test98.out test99.out \ + test100out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index e7ec617801..acb7bd76b5 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -34,7 +34,8 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test76.out test77.out test78.out test79.out test80.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ - test94.out test95.out test96.out test98.out test99.out + test94.out test95.out test96.out test98.out test99.out \ + test100.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 2001bfc2b7..816123d6f6 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2013 Sep 19 +# Last change: 2013 Nov 07 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -78,7 +78,8 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test77.out test78.out test79.out test80.out test81.out \ test82.out test83.out test84.out test88.out test89.out \ test90.out test91.out test92.out test93.out test94.out \ - test95.out test96.out test97.out test98.out test99.out + test95.out test96.out test97.out test98.out test99.out \ + test100.out # Known problems: # Test 30: a problem around mac format - unknown reason diff --git a/src/testdir/Makefile b/src/testdir/Makefile index f736d54d9e..3620cee178 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -30,7 +30,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out + test99.out test100.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test100.in b/src/testdir/test100.in new file mode 100644 index 0000000000..e42331946c --- /dev/null +++ b/src/testdir/test100.in @@ -0,0 +1,42 @@ +Tests for 'undolevel' setting being global-local + +STARTTEST +:so small.vim +:set nocompatible viminfo+=nviminfo ul=5 +:fu! FillBuffer() + :for i in range(1,13) + :put=i + :exe "setg ul=" . &g:ul + :endfor +:endfu +:fu! UndoLevel() + :redir @a | setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |redir end + :$put a +:endfu +:new one +:0put ='ONE: expecting global undolevels: 5, local undolevels: -123456 (default)' +:call FillBuffer() +:call feedkeys(":earlier 10\n", 't') +:call UndoLevel() +:%w! test.out +:new two +:0put ='TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)' +:setlocal ul=2 +:call FillBuffer() +:call feedkeys(":earlier 10\n", 't') +:call UndoLevel() +:setlocal ul=10 +:call UndoLevel() +:%w >> test.out +:wincmd p +:redir >>test.out | echo "global value shouldn't be changed and still be 5!" | echo 'ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'|:setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |echo "" |redir end +:new three +:setglobal ul=50 +:1put ='global value should be changed to 50' +:2put ='THREE: expecting global undolevels: 50, local undolevels: -123456 (default)' +:call UndoLevel() +:%w >> test.out +:"sleep 10 +:qa! +ENDTEST + diff --git a/src/testdir/test100.ok b/src/testdir/test100.ok new file mode 100644 index 0000000000..95b318461c --- /dev/null +++ b/src/testdir/test100.ok @@ -0,0 +1,41 @@ +ONE: expecting global undolevels: 5, local undolevels: -123456 (default) +1 +2 +3 +4 +5 +6 +7 + + + undolevels=5 global + undolevels=-123456 local +TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards) +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 + + + undolevels=5 global + undolevels=2 local + + undolevels=5 global + undolevels=10 local + +global value shouldn't be changed and still be 5! +ONE: expecting global undolevels: 5, local undolevels: -123456 (default) + undolevels=5 global + undolevels=-123456 local + +global value should be changed to 50 +THREE: expecting global undolevels: 50, local undolevels: -123456 (default) + + undolevels=50 global + undolevels=-123456 local diff --git a/src/version.c b/src/version.c index 60f9bf1b97..4b7b68ce0a 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 75, /**/ 74, /**/ From aa5f5aca78e462856e9f717ae0f0cfad29d5c68e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 03:26:06 +0100 Subject: [PATCH 047/105] Added tag v7-4-075 for changeset 829aa8c8449d --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 36285241e7..35d30087db 100644 --- a/.hgtags +++ b/.hgtags @@ -2797,3 +2797,4 @@ faf7e86203b5d5c98bdd30dd92524e5062b2412a v7-4-071 d563839a9be0be6e85d93e366b4f7ffe705d8e3b v7-4-072 d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 9818311eeca0d76641879e95143f314e7295cc26 v7-4-074 +829aa8c8449d85d0de3a29ac8ce647ec706efd02 v7-4-075 From c4267a57363cba506194f26a1264c5cc73e22735 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 04:46:48 +0100 Subject: [PATCH 048/105] updated for version 7.4.076 Problem: "cgn" does not wrap around the end of the file. (Dimitrov Dimitrov) Solution: Restore 'wrapscan' earlier. (Christian Brabandt) --- src/search.c | 3 +-- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/search.c b/src/search.c index 5d02dd9e33..d517c60529 100644 --- a/src/search.c +++ b/src/search.c @@ -4592,7 +4592,7 @@ current_search(count, forward) ml_get(curwin->w_buffer->b_ml.ml_line_count)); } } - + p_ws = old_p_ws; } start_pos = pos; @@ -4607,7 +4607,6 @@ current_search(count, forward) if (!VIsual_active) VIsual = start_pos; - p_ws = old_p_ws; curwin->w_cursor = pos; VIsual_active = TRUE; VIsual_mode = 'v'; diff --git a/src/version.c b/src/version.c index 4b7b68ce0a..770b3c8dba 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 76, /**/ 75, /**/ From 4dd5b701f0c44650373e59e4ff79bc060d744763 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 04:46:48 +0100 Subject: [PATCH 049/105] Added tag v7-4-076 for changeset 8f0c264db1e7 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 35d30087db..9798c69cc5 100644 --- a/.hgtags +++ b/.hgtags @@ -2798,3 +2798,4 @@ d563839a9be0be6e85d93e366b4f7ffe705d8e3b v7-4-072 d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 9818311eeca0d76641879e95143f314e7295cc26 v7-4-074 829aa8c8449d85d0de3a29ac8ce647ec706efd02 v7-4-075 +8f0c264db1e76a65499f0846d961907d7ecade9e v7-4-076 From 541644339fe99924f958bd479e25e37b1fd37687 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 04:49:27 +0100 Subject: [PATCH 050/105] updated for version 7.4.077 Problem: DOS installer creates shortcut without a path, resulting in the current directory to be C:\Windows\system32. Solution: Use environment variables. --- src/dosinst.c | 6 ++++-- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dosinst.c b/src/dosinst.c index 3c5e59bd5d..3fbfb5c5c2 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -1773,9 +1773,11 @@ build_shortcut( /* * We used to use "homedir" as the working directory, but that is a bad choice - * on multi-user systems. Not specifying a directory appears to work best. + * on multi-user systems. However, not specifying a directory results in the + * current directory to be c:\Windows\system32 on Windows 7. Use environment + * variables instead. */ -#define WORKDIR "" +#define WORKDIR "%HOMEDRIVE%%HOMEPATH%" /* * Create shortcut(s) in the Start Menu\Programs\Vim folder. diff --git a/src/version.c b/src/version.c index 770b3c8dba..6e11f7da18 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 77, /**/ 76, /**/ From 9d0ce391b952394bd0c6cb81725efa58d95f9d86 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Nov 2013 04:49:27 +0100 Subject: [PATCH 051/105] Added tag v7-4-077 for changeset 53bc55e58fef --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 9798c69cc5..97974e5937 100644 --- a/.hgtags +++ b/.hgtags @@ -2799,3 +2799,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 9818311eeca0d76641879e95143f314e7295cc26 v7-4-074 829aa8c8449d85d0de3a29ac8ce647ec706efd02 v7-4-075 8f0c264db1e76a65499f0846d961907d7ecade9e v7-4-076 +53bc55e58fefee7a83a7a56fc7f05e0a4d36dd47 v7-4-077 From e56b564188acd3f53de79c0d74577ff60fed9080 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 8 Nov 2013 03:15:47 +0100 Subject: [PATCH 052/105] updated for version 7.4.078 Problem: MSVC 2013 is not supported. Solution: Recognize and support MSVC 2013. (Ed Brown) --- src/Make_mvc.mak | 11 +++++++---- src/version.c | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index f23258b45a..9ae64db79e 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -424,6 +424,9 @@ MSVCVER = 11.0 !if "$(_NMAKE_VER)" == "11.00.60610.1" MSVCVER = 11.0 !endif +!if "$(_NMAKE_VER)" == "12.00.21005.1" +MSVCVER = 12.0 +!endif !endif # Abort building VIM if version of VC is unrecognised. @@ -438,7 +441,7 @@ MSVCVER = 11.0 !endif # Convert processor ID to MVC-compatible number -!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0") && ("$(MSVCVER)" != "11.0") +!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0") && ("$(MSVCVER)" != "11.0") && ("$(MSVCVER)" != "12.0") !if "$(CPUNR)" == "i386" CPUARG = /G3 !elseif "$(CPUNR)" == "i486" @@ -472,7 +475,7 @@ OPTFLAG = /O2 OPTFLAG = /Ox !endif -!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") +!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0") # Use link time code generation if not worried about size !if "$(OPTIMIZE)" != "SPACE" OPTFLAG = $(OPTFLAG) /GL @@ -485,7 +488,7 @@ CFLAGS=$(CFLAGS) $(WP64CHECK) !endif # Static code analysis generally available starting with VS2012 -!if ("$(ANALYZE)" == "yes") && ("$(MSVCVER)" == "11.0") +!if ("$(ANALYZE)" == "yes") && ("$(MSVCVER)" == "11.0") && ("$(MSVCVER)" == "12.0") CFLAGS=$(CFLAGS) /analyze !endif @@ -943,7 +946,7 @@ LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \ # Report link time code generation progress if used. !ifdef NODEBUG -!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") +!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0") !if "$(OPTIMIZE)" != "SPACE" LINKARGS1 = $(LINKARGS1) /LTCG:STATUS !endif diff --git a/src/version.c b/src/version.c index 6e11f7da18..aef0879923 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 78, /**/ 77, /**/ From 2d8f02c264d0fa885b7432239645c8ba30f211bc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 8 Nov 2013 03:15:47 +0100 Subject: [PATCH 053/105] Added tag v7-4-078 for changeset 5c3064feddd7 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 97974e5937..40f4aee57a 100644 --- a/.hgtags +++ b/.hgtags @@ -2800,3 +2800,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 829aa8c8449d85d0de3a29ac8ce647ec706efd02 v7-4-075 8f0c264db1e76a65499f0846d961907d7ecade9e v7-4-076 53bc55e58fefee7a83a7a56fc7f05e0a4d36dd47 v7-4-077 +5c3064feddd7c9bfef18d8067172335f101122c5 v7-4-078 From bbed82ee3ff8478e94f925cca7c71ef3c0725380 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 8 Nov 2013 04:30:20 +0100 Subject: [PATCH 054/105] updated for version 7.4.079 Problem: A script cannot detect whether 'hlsearch' highlighting is actually displayed. Solution: Add the "v:hlsearch" variable. (ZyX) --- src/eval.c | 9 ++++++++ src/ex_docmd.c | 2 +- src/option.c | 2 +- src/screen.c | 2 +- src/search.c | 10 +++++---- src/tag.c | 4 +++- src/testdir/Make_amiga.mak | 3 ++- src/testdir/Make_dos.mak | 2 +- src/testdir/Make_ming.mak | 2 +- src/testdir/Make_os2.mak | 2 +- src/testdir/Make_vms.mms | 4 ++-- src/testdir/Makefile | 2 +- src/testdir/test101.in | 45 ++++++++++++++++++++++++++++++++++++++ src/testdir/test101.ok | 11 ++++++++++ src/version.c | 2 ++ src/vim.h | 13 ++++++++--- 16 files changed, 97 insertions(+), 18 deletions(-) create mode 100644 src/testdir/test101.in create mode 100644 src/testdir/test101.ok diff --git a/src/eval.c b/src/eval.c index 14ba4d8b2d..9fbef244cd 100644 --- a/src/eval.c +++ b/src/eval.c @@ -356,6 +356,7 @@ static struct vimvar {VV_NAME("mouse_col", VAR_NUMBER), 0}, {VV_NAME("operator", VAR_STRING), VV_RO}, {VV_NAME("searchforward", VAR_NUMBER), 0}, + {VV_NAME("hlsearch", VAR_NUMBER), 0}, {VV_NAME("oldfiles", VAR_LIST), 0}, {VV_NAME("windowid", VAR_NUMBER), VV_RO}, }; @@ -871,6 +872,7 @@ eval_init() hash_add(&compat_hashtab, p->vv_di.di_key); } set_vim_var_nr(VV_SEARCHFORWARD, 1L); + set_vim_var_nr(VV_HLSEARCH, 1L); set_reg_var(0); /* default for v:register is not 0 but '"' */ #ifdef EBCDIC @@ -20613,6 +20615,13 @@ set_var(name, tv, copy) v->di_tv.vval.v_number = get_tv_number(tv); if (STRCMP(varname, "searchforward") == 0) set_search_direction(v->di_tv.vval.v_number ? '/' : '?'); +#ifdef FEAT_SEARCH_EXTRA + else if (STRCMP(varname, "hlsearch") == 0) + { + no_hlsearch = !v->di_tv.vval.v_number; + redraw_all_later(SOME_VALID); + } +#endif } return; } diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 24f80fbfa2..5d207ea802 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -11389,7 +11389,7 @@ ex_set(eap) ex_nohlsearch(eap) exarg_T *eap UNUSED; { - no_hlsearch = TRUE; + SET_NO_HLSEARCH(TRUE); redraw_all_later(SOME_VALID); } diff --git a/src/option.c b/src/option.c index 2b94d8525b..589e134445 100644 --- a/src/option.c +++ b/src/option.c @@ -7811,7 +7811,7 @@ set_bool_option(opt_idx, varp, value, opt_flags) /* when 'hlsearch' is set or reset: reset no_hlsearch */ else if ((int *)varp == &p_hls) { - no_hlsearch = FALSE; + SET_NO_HLSEARCH(FALSE); } #endif diff --git a/src/screen.c b/src/screen.c index a72ecaf20c..f738e2bb6a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -7447,7 +7447,7 @@ next_search_hl(win, shl, lnum, mincol) { /* don't free regprog in the match list, it's a copy */ vim_regfree(shl->rm.regprog); - no_hlsearch = TRUE; + SET_NO_HLSEARCH(TRUE); } shl->rm.regprog = NULL; shl->lnum = 0; diff --git a/src/search.c b/src/search.c index d517c60529..2fb7624c49 100644 --- a/src/search.c +++ b/src/search.c @@ -289,7 +289,7 @@ save_re_pat(idx, pat, magic) /* If 'hlsearch' set and search pat changed: need redraw. */ if (p_hls) redraw_all_later(SOME_VALID); - no_hlsearch = FALSE; + SET_NO_HLSEARCH(FALSE); #endif } } @@ -333,7 +333,7 @@ restore_search_patterns() spats[1] = saved_spats[1]; last_idx = saved_last_idx; # ifdef FEAT_SEARCH_EXTRA - no_hlsearch = saved_no_hlsearch; + SET_NO_HLSEARCH(saved_no_hlsearch); # endif } } @@ -1148,7 +1148,7 @@ do_search(oap, dirc, pat, count, options, tm) if (no_hlsearch && !(options & SEARCH_KEEP)) { redraw_all_later(SOME_VALID); - no_hlsearch = FALSE; + SET_NO_HLSEARCH(FALSE); } #endif @@ -5561,7 +5561,9 @@ read_viminfo_search_pattern(virp, force) spats[idx].off.off = off; #ifdef FEAT_SEARCH_EXTRA if (setlast) - no_hlsearch = !hlsearch_on; + { + SET_NO_HLSEARCH(!hlsearch_on); + } #endif } } diff --git a/src/tag.c b/src/tag.c index 55ace15bff..e7ea52a293 100644 --- a/src/tag.c +++ b/src/tag.c @@ -3330,7 +3330,9 @@ jumpto_tag(lbuf, forceit, keep_help) #ifdef FEAT_SEARCH_EXTRA /* restore no_hlsearch when keeping the old search pattern */ if (search_options) - no_hlsearch = save_no_hlsearch; + { + SET_NO_HLSEARCH(save_no_hlsearch); + } #endif /* Return OK if jumped to another file (at least we found the file!). */ diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 81633e7ca3..8842131b92 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -34,7 +34,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out test100.out + test99.out test100.out test101.out .SUFFIXES: .in .out @@ -151,3 +151,4 @@ test97.out: test97.in test98.out: test98.in test99.out: test99.in test100.out: test100.in +test101.out: test101.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index f89d99be73..38208e748c 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -33,7 +33,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100.out + test100.out test101.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index eb0c469df2..9ec1f06e64 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -53,7 +53,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100out + test100out test101.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index acb7bd76b5..823a706fab 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -35,7 +35,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100.out + test100.out test101.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 816123d6f6..2626b5bb9b 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2013 Nov 07 +# Last change: 2013 Nov 08 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -79,7 +79,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test82.out test83.out test84.out test88.out test89.out \ test90.out test91.out test92.out test93.out test94.out \ test95.out test96.out test97.out test98.out test99.out \ - test100.out + test100.out test101.out # Known problems: # Test 30: a problem around mac format - unknown reason diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 3620cee178..aa3777c92c 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -30,7 +30,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out test100.out + test99.out test100.out test101.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test101.in b/src/testdir/test101.in new file mode 100644 index 0000000000..04c934f2c5 --- /dev/null +++ b/src/testdir/test101.in @@ -0,0 +1,45 @@ +Test for v:hlsearch vim: set ft=vim : + +STARTTEST +:" Last abc: Q +:so small.vim +:new +:call setline(1, repeat(['aaa'], 10)) +:set hlsearch nolazyredraw +:let r=[] +:command -nargs=0 -bar AddR :call add(r, [screenattr(1, 1), v:hlsearch]) +/aaa +:AddR +:nohlsearch +:AddR +:let v:hlsearch=1 +:AddR +:let v:hlsearch=0 +:AddR +:set hlsearch +:AddR +:let v:hlsearch=0 +:AddR +n:AddR +:let v:hlsearch=0 +:AddR +/ +:AddR +:let r1=r[0][0] +:" I guess it is not guaranteed that screenattr outputs always the same character +:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")') +:try +: let v:hlsearch=[] +:catch +: call add(r, matchstr(v:exception,'^Vim(let):E\d\+:')) +:endtry +:bwipeout! +:$put=r +:call garbagecollect(1) +:" +:/^start:/,$wq! test.out +:" vim: et ts=4 isk-=\: +:call getchar() +ENDTEST + +start: diff --git a/src/testdir/test101.ok b/src/testdir/test101.ok new file mode 100644 index 0000000000..3ed7436cf7 --- /dev/null +++ b/src/testdir/test101.ok @@ -0,0 +1,11 @@ +start: +1:highlighted +0:not highlighted +1:highlighted +0:not highlighted +1:highlighted +0:not highlighted +1:highlighted +0:not highlighted +1:highlighted +Vim(let):E706: diff --git a/src/version.c b/src/version.c index aef0879923..106445a021 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 79, /**/ 78, /**/ diff --git a/src/vim.h b/src/vim.h index 3d61f3a35f..4d8d5e82fc 100644 --- a/src/vim.h +++ b/src/vim.h @@ -1864,9 +1864,10 @@ typedef int proftime_T; /* dummy for function prototypes */ #define VV_MOUSE_COL 51 #define VV_OP 52 #define VV_SEARCHFORWARD 53 -#define VV_OLDFILES 54 -#define VV_WINDOWID 55 -#define VV_LEN 56 /* number of v: vars */ +#define VV_HLSEARCH 54 +#define VV_OLDFILES 55 +#define VV_WINDOWID 56 +#define VV_LEN 57 /* number of v: vars */ #ifdef FEAT_CLIPBOARD @@ -2246,4 +2247,10 @@ typedef int VimClipboard; /* This is required for the prototypes. */ /* Character used as separated in autoload function/variable names. */ #define AUTOLOAD_CHAR '#' +#ifdef FEAT_EVAL +# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch) +#else +# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag) +#endif + #endif /* VIM__H */ From 59e67bb1ca2b3590e27a040af05d6e6f0dbb7bbb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 8 Nov 2013 04:30:20 +0100 Subject: [PATCH 055/105] Added tag v7-4-079 for changeset 6ae816249627 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 40f4aee57a..4eb5165667 100644 --- a/.hgtags +++ b/.hgtags @@ -2801,3 +2801,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 8f0c264db1e76a65499f0846d961907d7ecade9e v7-4-076 53bc55e58fefee7a83a7a56fc7f05e0a4d36dd47 v7-4-077 5c3064feddd7c9bfef18d8067172335f101122c5 v7-4-078 +6ae816249627b34aee618b49c4169b7ca1f54ff3 v7-4-079 From 9d665ac6f831421b1e311c74d3d41bf372abff0e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 01:44:43 +0100 Subject: [PATCH 056/105] updated for version 7.4.080 Problem: Missing documentation for v:hlsearch. Solution: Include the right file in the patch. --- runtime/doc/eval.txt | 7 +++++++ src/version.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5085f21ae8..bf01f37170 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1455,6 +1455,13 @@ v:foldend Used for 'foldtext': last line of closed fold. v:foldstart Used for 'foldtext': first line of closed fold. Read-only in the |sandbox|. |fold-foldtext| + *v:hlsearch* *hlsearch-variable* +v:hlsearch Variable that determines whether search highlighting is on. + Makes sense only if 'hlsearch' is enabled which requires + |+extra_search|. Setting this variable to zero acts the like + |:nohlsearch| command, setting it to one acts like > + let &hlsearch = &hlsearch +< *v:insertmode* *insertmode-variable* v:insertmode Used for the |InsertEnter| and |InsertChange| autocommand events. Values: diff --git a/src/version.c b/src/version.c index 106445a021..795aad06b6 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 80, /**/ 79, /**/ From 4d132236a3d989b09364c726cba0c594024771b5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 01:44:43 +0100 Subject: [PATCH 057/105] Added tag v7-4-080 for changeset c5166fa10464 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 4eb5165667..6723312b5c 100644 --- a/.hgtags +++ b/.hgtags @@ -2802,3 +2802,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 53bc55e58fefee7a83a7a56fc7f05e0a4d36dd47 v7-4-077 5c3064feddd7c9bfef18d8067172335f101122c5 v7-4-078 6ae816249627b34aee618b49c4169b7ca1f54ff3 v7-4-079 +c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 From 7bfece44c39c887527bbbebfa32267ed28df673b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 02:32:18 +0100 Subject: [PATCH 058/105] updated for version 7.4.081 Problem: Wrong logic when ANALYZE is "yes". Solution: Use or instead of and. (KF Leong) --- src/Make_mvc.mak | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 9ae64db79e..5a07cd095d 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -488,7 +488,7 @@ CFLAGS=$(CFLAGS) $(WP64CHECK) !endif # Static code analysis generally available starting with VS2012 -!if ("$(ANALYZE)" == "yes") && ("$(MSVCVER)" == "11.0") && ("$(MSVCVER)" == "12.0") +!if ("$(ANALYZE)" == "yes") && (("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0")) CFLAGS=$(CFLAGS) /analyze !endif diff --git a/src/version.c b/src/version.c index 795aad06b6..fdde4a9fab 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 81, /**/ 80, /**/ From bac669852a6eec8ca67465bdd274e280bd80e394 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 02:32:19 +0100 Subject: [PATCH 059/105] Added tag v7-4-081 for changeset 42927712b3d9 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6723312b5c..bc154c4566 100644 --- a/.hgtags +++ b/.hgtags @@ -2803,3 +2803,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 5c3064feddd7c9bfef18d8067172335f101122c5 v7-4-078 6ae816249627b34aee618b49c4169b7ca1f54ff3 v7-4-079 c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 +42927712b3d997bdba9d8ff5a1199fe4652c5899 v7-4-081 From 946ce5ad3d3bb6aa9d148708c499b7586515b918 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 03:31:51 +0100 Subject: [PATCH 060/105] updated for version 7.4.082 Problem: Using "gf" in a changed buffer suggests adding "!", which is not possible. (Tim Chase) Solution: Pass a flag to check_changed() wether adding ! make sense. --- src/ex_cmds.c | 8 +++++--- src/ex_cmds2.c | 40 ++++++++++++++++++++++++++-------------- src/ex_docmd.c | 12 +++++++++--- src/globals.h | 1 + src/proto/ex_cmds2.pro | 2 +- src/version.c | 2 ++ src/vim.h | 9 +++++++++ 7 files changed, 53 insertions(+), 21 deletions(-) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 76cc8f6d23..8f85911bad 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3253,8 +3253,10 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin) if ( ((!other_file && !(flags & ECMD_OLDBUF)) || (curbuf->b_nwindows == 1 && !(flags & (ECMD_HIDE | ECMD_ADDBUF)))) - && check_changed(curbuf, p_awa, !other_file, - (flags & ECMD_FORCEIT), FALSE)) + && check_changed(curbuf, (p_awa ? CCGD_AW : 0) + | (other_file ? 0 : CCGD_MULTWIN) + | ((flags & ECMD_FORCEIT) ? CCGD_FORCEIT : 0) + | (eap == NULL ? 0 : CCGD_EXCMD))) { if (fnum == 0 && other_file && ffname != NULL) (void)setaltfname(ffname, sfname, newlnum < 0 ? 0 : newlnum); @@ -7664,7 +7666,7 @@ ex_drop(eap) # ifdef FEAT_WINDOWS ++emsg_off; # endif - split = check_changed(curbuf, TRUE, FALSE, FALSE, FALSE); + split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD); # ifdef FEAT_WINDOWS --emsg_off; # else diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 4a860ca885..e66d4c571f 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1436,20 +1436,20 @@ autowrite_all() } /* - * return TRUE if buffer was changed and cannot be abandoned. + * Return TRUE if buffer was changed and cannot be abandoned. + * For flags use the CCGD_ values. */ int -check_changed(buf, checkaw, mult_win, forceit, allbuf) +check_changed(buf, flags) buf_T *buf; - int checkaw; /* do autowrite if buffer was changed */ - int mult_win; /* check also when several wins for the buf */ - int forceit; - int allbuf UNUSED; /* may write all buffers */ + int flags; { + int forceit = (flags & CCGD_FORCEIT); + if ( !forceit && bufIsChanged(buf) - && (mult_win || buf->b_nwindows <= 1) - && (!checkaw || autowrite(buf, forceit) == FAIL)) + && ((flags & CCGD_MULTWIN) || buf->b_nwindows <= 1) + && (!(flags & CCGD_AW) || autowrite(buf, forceit) == FAIL)) { #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) if ((p_confirm || cmdmod.confirm) && p_write) @@ -1457,7 +1457,7 @@ check_changed(buf, checkaw, mult_win, forceit, allbuf) buf_T *buf2; int count = 0; - if (allbuf) + if (flags & CCGD_ALLBUF) for (buf2 = firstbuf; buf2 != NULL; buf2 = buf2->b_next) if (bufIsChanged(buf2) && (buf2->b_ffname != NULL @@ -1480,7 +1480,10 @@ check_changed(buf, checkaw, mult_win, forceit, allbuf) return bufIsChanged(buf); } #endif - EMSG(_(e_nowrtmsg)); + if (flags & CCGD_EXCMD) + EMSG(_(e_nowrtmsg)); + else + EMSG(_(e_nowrtmsg_nobang)); return TRUE; } return FALSE; @@ -1690,7 +1693,9 @@ check_changed_any(hidden) { /* Try auto-writing the buffer. If this fails but the buffer no * longer exists it's not changed, that's OK. */ - if (check_changed(buf, p_awa, TRUE, FALSE, TRUE) && buf_valid(buf)) + if (check_changed(buf, (p_awa ? CCGD_AW : 0) + | CCGD_MULTWIN + | CCGD_ALLBUF) && buf_valid(buf)) break; /* didn't save - still changes */ } } @@ -2274,7 +2279,10 @@ do_argfile(eap, argn) vim_free(p); } if ((!P_HID(curbuf) || !other) - && check_changed(curbuf, TRUE, !other, eap->forceit, FALSE)) + && check_changed(curbuf, CCGD_AW + | (other ? 0 : CCGD_MULTWIN) + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) return; } @@ -2315,7 +2323,9 @@ ex_next(eap) */ if ( P_HID(curbuf) || eap->cmdidx == CMD_snext - || !check_changed(curbuf, TRUE, FALSE, eap->forceit, FALSE)) + || !check_changed(curbuf, CCGD_AW + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) { if (*eap->arg != NUL) /* redefine file list */ { @@ -2458,7 +2468,9 @@ ex_listdo(eap) if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo || P_HID(curbuf) - || !check_changed(curbuf, TRUE, FALSE, eap->forceit, FALSE)) + || !check_changed(curbuf, CCGD_AW + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) { /* start at the first argument/window/buffer */ i = 0; diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 5d207ea802..8d06a95c93 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -6565,7 +6565,9 @@ ex_quit(eap) if (check_more(FALSE, eap->forceit) == OK && only_one_window()) exiting = TRUE; if ((!P_HID(curbuf) - && check_changed(curbuf, p_awa, FALSE, eap->forceit, FALSE)) + && check_changed(curbuf, (p_awa ? CCGD_AW : 0) + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) || check_more(TRUE, eap->forceit) == FAIL || (only_one_window() && check_changed_any(eap->forceit))) { @@ -7099,7 +7101,7 @@ handle_drop(filec, filev, split) if (!P_HID(curbuf) && !split) { ++emsg_off; - split = check_changed(curbuf, TRUE, FALSE, FALSE, FALSE); + split = check_changed(curbuf, CCGD_AW); --emsg_off; } if (split) @@ -7361,7 +7363,11 @@ ex_recover(eap) { /* Set recoverymode right away to avoid the ATTENTION prompt. */ recoverymode = TRUE; - if (!check_changed(curbuf, p_awa, TRUE, eap->forceit, FALSE) + if (!check_changed(curbuf, (p_awa ? CCGD_AW : 0) + | CCGD_MULTWIN + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD) + && (*eap->arg == NUL || setfname(curbuf, eap->arg, NULL, TRUE) == OK)) ml_recover(); diff --git a/src/globals.h b/src/globals.h index feb1dd4577..916f7e31bc 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1490,6 +1490,7 @@ EXTERN char_u e_notmp[] INIT(= N_("E483: Can't get temp file name")); EXTERN char_u e_notopen[] INIT(= N_("E484: Can't open file %s")); EXTERN char_u e_notread[] INIT(= N_("E485: Can't read file %s")); EXTERN char_u e_nowrtmsg[] INIT(= N_("E37: No write since last change (add ! to override)")); +EXTERN char_u e_nowrtmsg_nobang[] INIT(= N_("E37: No write since last change")); EXTERN char_u e_null[] INIT(= N_("E38: Null argument")); #ifdef FEAT_DIGRAPHS EXTERN char_u e_number_exp[] INIT(= N_("E39: Number expected")); diff --git a/src/proto/ex_cmds2.pro b/src/proto/ex_cmds2.pro index d30ba41efa..0ac3e14924 100644 --- a/src/proto/ex_cmds2.pro +++ b/src/proto/ex_cmds2.pro @@ -35,7 +35,7 @@ void prof_inchar_exit __ARGS((void)); int prof_def_func __ARGS((void)); int autowrite __ARGS((buf_T *buf, int forceit)); void autowrite_all __ARGS((void)); -int check_changed __ARGS((buf_T *buf, int checkaw, int mult_win, int forceit, int allbuf)); +int check_changed __ARGS((buf_T *buf, int flags)); void browse_save_fname __ARGS((buf_T *buf)); void dialog_changed __ARGS((buf_T *buf, int checkall)); int can_abandon __ARGS((buf_T *buf, int forceit)); diff --git a/src/version.c b/src/version.c index fdde4a9fab..e4b039e31d 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 82, /**/ 81, /**/ diff --git a/src/vim.h b/src/vim.h index 4d8d5e82fc..88f3dc29b4 100644 --- a/src/vim.h +++ b/src/vim.h @@ -1175,6 +1175,15 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); #define RESIZE_HOR 2 /* resize horizontally */ #define RESIZE_BOTH 15 /* resize in both directions */ +/* + * flags for check_changed() + */ +#define CCGD_AW 1 /* do autowrite if buffer was changed */ +#define CCGD_MULTWIN 2 /* check also when several wins for the buf */ +#define CCGD_FORCEIT 4 /* ! used */ +#define CCGD_ALLBUF 8 /* may write all buffers */ +#define CCGD_EXCMD 16 /* may suggest using ! */ + /* * "flags" values for option-setting functions. * When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global From 2aae64e6509aaa4f804da33f13ab7376915cfd12 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 03:31:51 +0100 Subject: [PATCH 061/105] Added tag v7-4-082 for changeset 9c777e2c7024 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bc154c4566..3980c6abe6 100644 --- a/.hgtags +++ b/.hgtags @@ -2804,3 +2804,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 6ae816249627b34aee618b49c4169b7ca1f54ff3 v7-4-079 c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 42927712b3d997bdba9d8ff5a1199fe4652c5899 v7-4-081 +9c777e2c702487bd0b5c48a22edc17c98b87e070 v7-4-082 From 6c3976769afd362c1f568bd0b0ba3eddefa1d819 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 03:41:58 +0100 Subject: [PATCH 062/105] Updated runtime files. --- runtime/doc/change.txt | 6 +++--- runtime/doc/eval.txt | 5 ++++- runtime/doc/indent.txt | 2 +- runtime/doc/options.txt | 2 +- runtime/doc/tags | 3 +++ runtime/doc/todo.txt | 45 +++++++---------------------------------- runtime/syntax/svn.vim | 34 +++++++++++++++++++++---------- 7 files changed, 42 insertions(+), 55 deletions(-) diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 77c791ed56..5fe89eb4e5 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.4. Last change: 2013 Aug 25 +*change.txt* For Vim version 7.4. Last change: 2013 Nov 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -475,8 +475,8 @@ If the 'shiftround' option is on, the indent is rounded to a multiple of 'shiftwidth'. If the 'smartindent' option is on, or 'cindent' is on and 'cinkeys' contains -'#', shift right does not affect lines starting with '#' (these are supposed -to be C preprocessor lines that must stay in column 1). +'#' with a zero value, shift right does not affect lines starting with '#' +(these are supposed to be C preprocessor lines that must stay in column 1). When the 'expandtab' option is off (this is the default) Vim uses s as much as possible to make the indent. You can use ">><<" to replace an indent diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index bf01f37170..08edd10618 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2013 Nov 02 +*eval.txt* For Vim version 7.4. Last change: 2013 Nov 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4235,6 +4235,9 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) "match"). It will be highlighted with {group}. Returns an identification number (ID), which can be used to delete the match using |matchdelete()|. + Matching is case sensitive and magic, unless case sensitivity + or magicness are explicitly overridden in {pattern}. The + 'magic', 'smartcase' and 'ignorecase' options are not used. The optional {priority} argument assigns a priority to the match. A match with a high priority will have its diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 3a2a208e85..1f7754b580 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 7.4. Last change: 2013 Aug 03 +*indent.txt* For Vim version 7.4. Last change: 2013 Nov 05 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 8d8c954f7a..24adfb896c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2013 Aug 22 +*options.txt* For Vim version 7.4. Last change: 2013 Nov 06 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tags b/runtime/doc/tags index f32ea6ffee..73475a9d69 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4902,6 +4902,7 @@ builtin_terms term.txt /*builtin_terms* byte-count editing.txt /*byte-count* byte2line() eval.txt /*byte2line()* byteidx() eval.txt /*byteidx()* +byteidxcomp() eval.txt /*byteidxcomp()* bzip2 pi_gzip.txt /*bzip2* c change.txt /*c* c.vim syntax.txt /*c.vim* @@ -6360,6 +6361,7 @@ hl-WarningMsg syntax.txt /*hl-WarningMsg* hl-WildMenu syntax.txt /*hl-WildMenu* hlID() eval.txt /*hlID()* hlexists() eval.txt /*hlexists()* +hlsearch-variable eval.txt /*hlsearch-variable* holy-grail index.txt /*holy-grail* home intro.txt /*home* home-replace editing.txt /*home-replace* @@ -8366,6 +8368,7 @@ v:folddashes eval.txt /*v:folddashes* v:foldend eval.txt /*v:foldend* v:foldlevel eval.txt /*v:foldlevel* v:foldstart eval.txt /*v:foldstart* +v:hlsearch eval.txt /*v:hlsearch* v:insertmode eval.txt /*v:insertmode* v:key eval.txt /*v:key* v:lang eval.txt /*v:lang* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index d1d39742da..512a3827e5 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2013 Nov 03 +*todo.txt* For Vim version 7.4. Last change: 2013 Nov 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,7 +34,12 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- -Revert patch 7.4.056? Do it differently? +Patch From Lech Lorens doesn't quite work: +Problem: When using ":'<,'>del" errors may be given for the visual line + numbers being out of range. +Solution: Reset Visual mode in ":del". (Lech Lorens) +Files: src/ex_docmd.c + Using \1 in pattern goes one line too far. (Bohr Shaw, 2013 Sep 5) Column is OK. "/\v(^.+\n)\1/e" (John Little, Sep 5) @@ -58,59 +63,23 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) Issue 164: freeze on regexp search. -Patch to Fix Python: DictionaryContains return -1 on error. (ZyX, 2013 Nov 1) - -Patch to fix that inserting CR when replacing a Visual block doesn't cause a -line break. (Christian Brabandt, 2013 Oct 19) -Check: does CTRL-V CR insert a literal CR? New patch Oct 21 -With test Oct 22. - -When recording the character typed at the hit-enter prompt is recorded twice. -(Urtica Dioica) Patch by Christian Brabandt, 2013 Oct 8. - Update for Clojure ftplugin. (Sung Pae). Await discussion about formatting in ftplugins. Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) -Patch to avoid problem with colon in file name. (Yasuhiro Matsumoto, 2013 Sep -5) Only copy file name when needed: Sep 9. - -After inserting comment leader, CTRL-\ CTRL-O does move the cursor. -(Wiktor Ruben, 2013 Oct 7) -Patch by Christian Brabandt. - Patch to support slices in Python vim.List. (ZyX, 2013 Oct 20) Patch to support iterator on Python vim.options. (ZyX, 2013 Nov 2) -Patch to avoid "-no-cpp-precomp" on Mac. (Misty De Meo, demeo, 2013 Oct 19) - Patch to make Dictionary.update() work without arguments. (ZyX, 2013 Oct 19) -Patch to make #N in 'cino' stop not indenting #lines. (Christian Brabandt, -2013 Sep 25) - Patch for Cobol ftplugin. (ZyX, 2013 Oct 20) Await response from maintainer. -Can 'undolevels' be a buffer-local option? Helps for making big changes in -one file only, set 'ul' to -1 only for that buffer. -Patch by Christian Brabandt, 2010 Dec 17. Needs test. - Include systemverilog file? Two votes yes. -Wrapping around end of file does not work for "." after "cgn". (Dimitar -Dimitrov) -Patch by Christian Brabandt, 2013 Aug 22 - -Clang error for integer overflow. (Dominique Pelle, 2013 Sep 21) - -Patch to add v:hlsearch. (ZyX, 2013 Sep 22) - -Patch to fix E315 error. (Lech Lorens, 2013 Oct 26) - Patch to add :keeppatterns, don't put used search patterns in history. (Christian Brabandt, 2013 Oct 18) diff --git a/runtime/syntax/svn.vim b/runtime/syntax/svn.vim index 83803e3319..6536d6d11c 100644 --- a/runtime/syntax/svn.vim +++ b/runtime/syntax/svn.vim @@ -2,15 +2,18 @@ " Language: Subversion (svn) commit file " Maintainer: Dmitry Vasiliev " URL: https://github.com/hdima/vim-scripts/blob/master/syntax/svn.vim -" Last Change: 2012-07-21 +" Last Change: 2013-11-08 " Filenames: svn-commit*.tmp -" Version: 1.9 +" Version: 1.10 " Contributors: -" Stefano Zacchiroli +" +" List of the contributors in alphabetical order: +" " A. S. Budden -" Myk Taylor " Ingo Karkat +" Myk Taylor +" Stefano Zacchiroli " For version 5.x: Clear all syntax items. " For version 6.x: Quit when a syntax file was already loaded. @@ -20,14 +23,19 @@ elseif exists("b:current_syntax") finish endif -syn region svnText start="\%^" end="^--.*--$"me=s-1 contains=@Spell +syn spell toplevel -syn region svnRegion start="^--.*--$" end="\%$" contains=ALL -syn match svnRemoved "^D .*$" contained -syn match svnRenamed "^R[ M][ U][ +] .*$" contained -syn match svnAdded "^A[ M][ U][ +] .*$" contained -syn match svnModified "^M[ M][ U] .*$" contained -syn match svnProperty "^_M[ U] .*$" contained +syn match svnFirstLine "\%^.*" nextgroup=svnRegion,svnBlank skipnl +syn match svnSummary "^.\{0,50\}" contained containedin=svnFirstLine nextgroup=svnOverflow contains=@Spell +syn match svnOverflow ".*" contained contains=@Spell +syn match svnBlank "^.*" contained contains=@Spell + +syn region svnRegion end="\%$" matchgroup=svnDelimiter start="^--.*--$" contains=svnRemoved,svnRenamed,svnAdded,svnModified,svnProperty,@NoSpell +syn match svnRemoved "^D .*$" contained contains=@NoSpell +syn match svnRenamed "^R[ M][ U][ +] .*$" contained contains=@NoSpell +syn match svnAdded "^A[ M][ U][ +] .*$" contained contains=@NoSpell +syn match svnModified "^M[ M][ U] .*$" contained contains=@NoSpell +syn match svnProperty "^_M[ U] .*$" contained contains=@NoSpell " Synchronization. syn sync clear @@ -44,7 +52,11 @@ if version >= 508 || !exists("did_svn_syn_inits") command -nargs=+ HiLink hi def link endif + HiLink svnSummary Keyword + HiLink svnBlank Error + HiLink svnRegion Comment + HiLink svnDelimiter NonText HiLink svnRemoved Constant HiLink svnAdded Identifier HiLink svnModified Special From c5fdc66dd95afd5fe1fe8a7bbd064a4bb5de9bc3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 05:30:26 +0100 Subject: [PATCH 063/105] updated for version 7.4.083 Problem: It's hard to avoid adding a used pattern to the search history. Solution: Add the ":keeppatterns" modifier. (Christian Brabandt) --- runtime/doc/cmdline.txt | 4 ++++ src/ex_cmds.h | 2 ++ src/ex_docmd.c | 8 ++++++++ src/ex_getln.c | 3 +++ src/structs.h | 1 + src/version.c | 2 ++ 6 files changed, 20 insertions(+) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 36a71cfccc..c309a0f7a1 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -356,6 +356,10 @@ terminals) List the recent five entries from all histories: > :history all -5, +:keepp[atterns] {command} *:keepp* *:keeppatterns* + Execute {command}, without adding anything to the search + history + ============================================================================== 2. Command-line completion *cmdline-completion* diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 86bcead76a..6cc4c7e138 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -477,6 +477,8 @@ EX(CMD_keepmarks, "keepmarks", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM), EX(CMD_keepjumps, "keepjumps", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM), +EX(CMD_keeppatterns, "keeppatterns", ex_wrongmodifier, + NEEDARG|EXTRA|NOTRLCOM), EX(CMD_keepalt, "keepalt", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM), EX(CMD_list, "list", ex_print, diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 8d06a95c93..1c700d4735 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1843,6 +1843,11 @@ do_one_cmd(cmdlinep, sourcing, cmdmod.keepalt = TRUE; continue; } + if (checkforcmd(&ea.cmd, "keeppatterns", 5)) + { + cmdmod.keeppatterns = TRUE; + continue; + } if (!checkforcmd(&ea.cmd, "keepjumps", 5)) break; cmdmod.keepjumps = TRUE; @@ -2584,6 +2589,7 @@ do_one_cmd(cmdlinep, sourcing, case CMD_keepalt: case CMD_keepjumps: case CMD_keepmarks: + case CMD_keeppatterns: case CMD_leftabove: case CMD_let: case CMD_lockmarks: @@ -3089,6 +3095,7 @@ static struct cmdmod {"keepalt", 5, FALSE}, {"keepjumps", 5, FALSE}, {"keepmarks", 3, FALSE}, + {"keeppatterns", 5, FALSE}, {"leftabove", 5, FALSE}, {"lockmarks", 3, FALSE}, {"noautocmd", 3, FALSE}, @@ -3597,6 +3604,7 @@ set_one_cmd_context(xp, buff) case CMD_keepalt: case CMD_keepjumps: case CMD_keepmarks: + case CMD_keeppatterns: case CMD_leftabove: case CMD_lockmarks: case CMD_rightbelow: diff --git a/src/ex_getln.c b/src/ex_getln.c index 7ec47c7028..906eb8bb0c 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -5498,6 +5498,9 @@ add_to_history(histype, new_entry, in_map, sep) if (hislen == 0) /* no history */ return; + if (cmdmod.keeppatterns && histype == HIST_SEARCH) + return; + /* * Searches inside the same mapping overwrite each other, so that only * the last line is kept. Be careful not to remove a line that was moved diff --git a/src/structs.h b/src/structs.h index f3f3aaa89b..3c3fd7ba27 100644 --- a/src/structs.h +++ b/src/structs.h @@ -542,6 +542,7 @@ typedef struct int keepmarks; /* TRUE when ":keepmarks" was used */ int keepjumps; /* TRUE when ":keepjumps" was used */ int lockmarks; /* TRUE when ":lockmarks" was used */ + int keeppatterns; /* TRUE when ":keeppatterns" was used */ # ifdef FEAT_AUTOCMD char_u *save_ei; /* saved value of 'eventignore' */ # endif diff --git a/src/version.c b/src/version.c index e4b039e31d..ce5d25053d 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 83, /**/ 82, /**/ From d872f263e3a70b315ee3fc5f9e72fd296c5c085a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Nov 2013 05:30:27 +0100 Subject: [PATCH 064/105] Added tag v7-4-083 for changeset 6367a766027d --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3980c6abe6..81ee321d06 100644 --- a/.hgtags +++ b/.hgtags @@ -2805,3 +2805,4 @@ d0595545e98a3b7b6fe1a96ab0106d8afd63c31e v7-4-073 c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 42927712b3d997bdba9d8ff5a1199fe4652c5899 v7-4-081 9c777e2c702487bd0b5c48a22edc17c98b87e070 v7-4-082 +6367a766027d3b60caff43c35d8d3597ad90f6c6 v7-4-083 From 7d889b5942848b3901c33d11fc2f33670103b0bd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 01:05:48 +0100 Subject: [PATCH 065/105] updated for version 7.4.084 Problem: Python: interrupt not being properly discarded. (Yggdroot Chen) Solution: Discard interrupt in VimTryEnd. (ZyX) --- src/if_py_both.h | 11 +++++++++-- src/testdir/test86.in | 31 +++++++++++++++++++++++++++++++ src/testdir/test86.ok | 4 ++++ src/testdir/test87.in | 31 +++++++++++++++++++++++++++++++ src/testdir/test87.ok | 4 ++++ src/version.c | 2 ++ 6 files changed, 81 insertions(+), 2 deletions(-) diff --git a/src/if_py_both.h b/src/if_py_both.h index 748577981c..e6db4a3d03 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -558,7 +558,11 @@ VimTryEnd(void) /* Keyboard interrupt should be preferred over anything else */ if (got_int) { - did_throw = got_int = FALSE; + if (current_exception != NULL) + discard_current_exception(); + else + need_rethrow = did_throw = FALSE; + got_int = FALSE; PyErr_SetNone(PyExc_KeyboardInterrupt); return -1; } @@ -567,7 +571,10 @@ VimTryEnd(void) /* Python exception is preferred over vim one; unlikely to occur though */ else if (PyErr_Occurred()) { - did_throw = FALSE; + if (current_exception != NULL) + discard_current_exception(); + else + need_rethrow = did_throw = FALSE; return -1; } /* Finally transform VimL exception to python one */ diff --git a/src/testdir/test86.in b/src/testdir/test86.in index 48fa4e5a1d..91f771dcf0 100644 --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -1281,6 +1281,37 @@ del Exe EOF :delfunction Exe :" +:" Regression: interrupting vim.command propagates to next vim.command +py << EOF +def test_keyboard_interrupt(): + try: + vim.command('while 1 | endwhile') + except KeyboardInterrupt: + cb.append('Caught KeyboardInterrupt') + except Exception: + cb.append('!!!!!!!! Caught exception: ' + repr(sys.exc_info)) + else: + cb.append('!!!!!!!! No exception') + try: + vim.command('$ put =\'Running :put\'') + except KeyboardInterrupt: + cb.append('!!!!!!!! Caught KeyboardInterrupt') + except Exception: + cb.append('!!!!!!!! Caught exception: ' + repr(sys.exc_info)) + else: + cb.append('No exception') +EOF +:debuggreedy +:call inputsave() +:call feedkeys("s\ns\ns\ns\nq\n") +:redir => output +:debug silent! py test_keyboard_interrupt() +:redir END +:0 debuggreedy +:silent $put =output +:unlet output +:py del test_keyboard_interrupt +:" :" Cleanup py << EOF del cb diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok index 69c98d02d3..2d5b1619e9 100644 --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -1198,3 +1198,7 @@ vim.eval("Exe('throw ''ghi''')"):error:('ghi',) vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',) vim.eval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',) vim.bindeval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',) +Caught KeyboardInterrupt +Running :put +No exception + diff --git a/src/testdir/test87.in b/src/testdir/test87.in index 54cd97748f..899e4f3389 100644 --- a/src/testdir/test87.in +++ b/src/testdir/test87.in @@ -1232,6 +1232,37 @@ del Exe EOF :delfunction Exe :" +:" Regression: interrupting vim.command propagates to next vim.command +py3 << EOF +def test_keyboard_interrupt(): + try: + vim.command('while 1 | endwhile') + except KeyboardInterrupt: + cb.append('Caught KeyboardInterrupt') + except Exception as e: + cb.append('!!!!!!!! Caught exception: ' + repr(e)) + else: + cb.append('!!!!!!!! No exception') + try: + vim.command('$ put =\'Running :put\'') + except KeyboardInterrupt: + cb.append('!!!!!!!! Caught KeyboardInterrupt') + except Exception as e: + cb.append('!!!!!!!! Caught exception: ' + repr(e)) + else: + cb.append('No exception') +EOF +:debuggreedy +:call inputsave() +:call feedkeys("s\ns\ns\ns\nq\n") +:redir => output +:debug silent! py3 test_keyboard_interrupt() +:redir END +:0 debuggreedy +:silent $put =output +:unlet output +:py3 del test_keyboard_interrupt +:" :" Cleanup py3 << EOF del cb diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok index eed179c5a9..970818c997 100644 --- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -1187,3 +1187,7 @@ vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) vim.eval("Exe('echoerr ''jkl''')"):(, error('Vim(echoerr):jkl',)) vim.eval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +Caught KeyboardInterrupt +Running :put +No exception + diff --git a/src/version.c b/src/version.c index ce5d25053d..f9bb7dd9f3 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 84, /**/ 83, /**/ From f0e731d5c4a4bcd280967ee2a4e0745224ecc1f9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 01:05:48 +0100 Subject: [PATCH 066/105] Added tag v7-4-084 for changeset a56f60cf6834 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 81ee321d06..dec941912a 100644 --- a/.hgtags +++ b/.hgtags @@ -2806,3 +2806,4 @@ c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 42927712b3d997bdba9d8ff5a1199fe4652c5899 v7-4-081 9c777e2c702487bd0b5c48a22edc17c98b87e070 v7-4-082 6367a766027d3b60caff43c35d8d3597ad90f6c6 v7-4-083 +a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 From ba12de06a42b9bfd9bc9db9bdc8befbc87aa51b4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 01:29:22 +0100 Subject: [PATCH 067/105] updated for version 7.4.085 Problem: When inserting text in Visual block mode and moving the cursor the wrong text gets repeated in other lines. Solution: Use the '[ mark to find the start of the actually inserted text. (Christian Brabandt) --- src/ops.c | 25 +++++++++++++++++++++++++ src/testdir/test39.in | 9 +++++++++ src/testdir/test39.ok | Bin 340 -> 377 bytes src/version.c | 2 ++ 4 files changed, 36 insertions(+) diff --git a/src/ops.c b/src/ops.c index 7571dc5c9e..0aebfa14f4 100644 --- a/src/ops.c +++ b/src/ops.c @@ -2640,6 +2640,31 @@ op_insert(oap, count1) { struct block_def bd2; + /* The user may have moved the cursor before inserting something, try + * to adjust the block for that. */ + if (oap->start.lnum == curbuf->b_op_start.lnum) + { + if (oap->op_type == OP_INSERT + && oap->start.col != curbuf->b_op_start.col) + { + oap->start.col = curbuf->b_op_start.col; + pre_textlen -= getviscol2(oap->start.col, oap->start.coladd) + - oap->start_vcol; + oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd); + } + else if (oap->op_type == OP_APPEND + && oap->end.col >= curbuf->b_op_start.col) + { + oap->start.col = curbuf->b_op_start.col; + /* reset pre_textlen to the value of OP_INSERT */ + pre_textlen += bd.textlen; + pre_textlen -= getviscol2(oap->start.col, oap->start.coladd) + - oap->start_vcol; + oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd); + oap->op_type = OP_INSERT; + } + } + /* * Spaces and tabs in the indent may have changed to other spaces and * tabs. Get the starting column again and correct the length. diff --git a/src/testdir/test39.in b/src/testdir/test39.in index 96995e0896..77e2bd7689 100644 --- a/src/testdir/test39.in +++ b/src/testdir/test39.in @@ -19,6 +19,10 @@ Gllllkkklllrq :" Test block-change G$khhhhhkkcmno :$-4,$w! test.out +:" Test block-insert using cursor keys for movement +/^aaaa/ +:exe ":norm! l\jjjlllI\\ \" +:/^aa/,/^$/w >> test.out :" gUe must uppercase a whole word, also when changes to SS Gothe youtueuu endYpk0wgUe :" gUfx must uppercase until x, inclusive. @@ -40,6 +44,11 @@ G3o987652k02l2jr :qa! ENDTEST +aaaaaa +bbbbbb +cccccc +dddddd + abcdefghijklm abcdefghijklm abcdefghijklm diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok index 4ebecf6cde60bfb4f90cf2960c4ffec2011efbda..4964d6a34b93691f1a8530296cb2a2994973317a 100644 GIT binary patch delta 46 wcmcb@^pj~qj!I%;qJjdD;7UqLQcwUAT*=AF3JO4iD Date: Mon, 11 Nov 2013 01:29:22 +0100 Subject: [PATCH 068/105] Added tag v7-4-085 for changeset 70c3289803b3 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index dec941912a..c2dca2e0e4 100644 --- a/.hgtags +++ b/.hgtags @@ -2807,3 +2807,4 @@ c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 9c777e2c702487bd0b5c48a22edc17c98b87e070 v7-4-082 6367a766027d3b60caff43c35d8d3597ad90f6c6 v7-4-083 a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 +70c3289803b3129f34ffc327b113dcf152222a56 v7-4-085 From fb3d6aa84aa1689172f5cff90f7e6b17238b3ffe Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 04:25:53 +0100 Subject: [PATCH 069/105] updated for version 7.4.086 Problem: Skipping over an expression when not evaluating it does not work properly for dict members. Solution: Skip over unrecognized expression. (ZyX) --- src/eval.c | 18 ++++++++++++------ src/testdir/test34.in | 13 ++++++++++++- src/testdir/test34.ok | 2 ++ src/version.c | 2 ++ 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/eval.c b/src/eval.c index 9fbef244cd..5d8c7c8a2a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -19845,24 +19845,30 @@ handle_subscript(arg, rettv, evaluate, verbose) while (ret == OK && (**arg == '[' || (**arg == '.' && rettv->v_type == VAR_DICT) - || (**arg == '(' && rettv->v_type == VAR_FUNC)) + || (**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC))) && !vim_iswhite(*(*arg - 1))) { if (**arg == '(') { /* need to copy the funcref so that we can clear rettv */ - functv = *rettv; - rettv->v_type = VAR_UNKNOWN; + if (evaluate) + { + functv = *rettv; + rettv->v_type = VAR_UNKNOWN; - /* Invoke the function. Recursive! */ - s = functv.vval.v_string; + /* Invoke the function. Recursive! */ + s = functv.vval.v_string; + } + else + s = (char_u *)""; ret = get_func_tv(s, (int)STRLEN(s), rettv, arg, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &len, evaluate, selfdict); /* Clear the funcref afterwards, so that deleting it while * evaluating the arguments is possible (see test55). */ - clear_tv(&functv); + if (evaluate) + clear_tv(&functv); /* Stop the expression evaluation when immediately aborting on * error, or when an interrupt occurred or an exception was thrown diff --git a/src/testdir/test34.in b/src/testdir/test34.in index 5abc140be0..71ee5f63b2 100644 --- a/src/testdir/test34.in +++ b/src/testdir/test34.in @@ -1,6 +1,7 @@ Test for user functions. Also test an mapping calling a function. Also test that a builtin function cannot be replaced. +Also test for regression when calling arbitrary expression. STARTTEST :so small.vim @@ -62,7 +63,17 @@ XX+-XX [(one again:call append(line('$'), max([1, 2, 3])) :call extend(g:, {'max': function('min')}) :call append(line('$'), max([1, 2, 3])) -:$-7,$w! test.out +:try +: " Regression: the first line below used to throw ?E110: Missing ')'? +: " Second is here just to prove that this line is correct when not skipping +: " rhs of &&. +: $put =(0&&(function('tr'))(1, 2, 3)) +: $put =(1&&(function('tr'))(1, 2, 3)) +:catch +: $put ='!!! Unexpected exception:' +: $put =v:exception +:endtry +:$-9,$w! test.out :delfunc Table :delfunc Compute :delfunc Expr1 diff --git a/src/testdir/test34.ok b/src/testdir/test34.ok index 6053812274..97995de80e 100644 --- a/src/testdir/test34.ok +++ b/src/testdir/test34.ok @@ -6,3 +6,5 @@ XX111-XX 1. one again 3 3 +0 +1 diff --git a/src/version.c b/src/version.c index af31b4752b..f4555c7261 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 86, /**/ 85, /**/ From a550bc6bbbe8fffc1aea785ea8981222c197c4d5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 04:25:53 +0100 Subject: [PATCH 070/105] Added tag v7-4-086 for changeset 60a5b7b82016 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c2dca2e0e4..577ebe9112 100644 --- a/.hgtags +++ b/.hgtags @@ -2808,3 +2808,4 @@ c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 6367a766027d3b60caff43c35d8d3597ad90f6c6 v7-4-083 a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 70c3289803b3129f34ffc327b113dcf152222a56 v7-4-085 +60a5b7b82016da631dd7acc6121913d02c5677f8 v7-4-086 From d62bc067e9486174cc2c9bb30a8d702610619eb6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 23:17:39 +0100 Subject: [PATCH 071/105] updated for version 7.4.087 Problem: Compiler warning on 64 bit Windows systems. Solution: Fix type cast. (Mike Williams) --- src/ops.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ops.c b/src/ops.c index 0aebfa14f4..bf65191899 100644 --- a/src/ops.c +++ b/src/ops.c @@ -2193,7 +2193,8 @@ op_replace(oap, c) else { /* Replacing with \r or \n means splitting the line. */ - after_p = alloc_check((unsigned)oldlen + 1 + n - STRLEN(newp)); + after_p = alloc_check( + (unsigned)(oldlen + 1 + n - STRLEN(newp))); if (after_p != NULL) STRMOVE(after_p, oldp); } diff --git a/src/version.c b/src/version.c index f4555c7261..9b78b171dd 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 87, /**/ 86, /**/ From 6f4966746c5eb54b72172b596a3aa8426c1a3a79 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 11 Nov 2013 23:17:39 +0100 Subject: [PATCH 072/105] Added tag v7-4-087 for changeset 9334c994be7b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 577ebe9112..ba089ef0bb 100644 --- a/.hgtags +++ b/.hgtags @@ -2809,3 +2809,4 @@ c5166fa1046462d73891f0b395d6619e7ce96c82 v7-4-080 a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 70c3289803b3129f34ffc327b113dcf152222a56 v7-4-085 60a5b7b82016da631dd7acc6121913d02c5677f8 v7-4-086 +9334c994be7bb5e16a1f9c6b67e1c4342a6a386c v7-4-087 From c0bbc0b2c769a9b77e1a75cbadf1c074e76ae81b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 04:44:01 +0100 Subject: [PATCH 073/105] updated for version 7.4.088 Problem: When spell checking is enabled Asian characters are always marked as error. Solution: When 'spelllang' contains "cjk" do not mark Asian characters as error. (Ken Takata) --- runtime/doc/options.txt | 3 ++ runtime/doc/spell.txt | 7 +++++ src/mbyte.c | 18 +++++++----- src/option.c | 10 +++++-- src/spell.c | 62 ++++++++++++++++++++++++++--------------- src/structs.h | 3 ++ src/version.c | 2 ++ 7 files changed, 72 insertions(+), 33 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 24adfb896c..a515900291 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6555,6 +6555,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. + If the name "cjk" is included East Asian characters are excluded from + spell checking. This is useful when editing text that also has Asian + words. *E757* As a special case the name of a .spl file can be given as-is. The first "_xx" in the name is removed and used as the region name diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index c2b526d175..d2dde05ec4 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -269,6 +269,13 @@ In a table: latin1 yi transliterated Yiddish utf-8 yi-tr transliterated Yiddish + *spell-cjk* +Chinese, Japanese and other East Asian characters are normally marked as +errors, because spell checking of these characters is not supported. If +'spelllang' includes "cjk", these characters are not marked as errors. This +is useful when editing text with spell checking while some Asian words are +present. + SPELL FILES *spell-load* diff --git a/src/mbyte.c b/src/mbyte.c index 68c1e941dc..6340992de4 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -947,8 +947,8 @@ dbcs_class(lead, trail) { case 0x2121: /* ZENKAKU space */ return 0; - case 0x2122: /* KU-TEN (Japanese comma) */ - case 0x2123: /* TOU-TEN (Japanese period) */ + case 0x2122: /* TOU-TEN (Japanese comma) */ + case 0x2123: /* KU-TEN (Japanese period) */ case 0x2124: /* ZENKAKU comma */ case 0x2125: /* ZENKAKU period */ return 1; @@ -2477,9 +2477,9 @@ utf_class(c) /* sorted list of non-overlapping intervals */ static struct clinterval { - unsigned short first; - unsigned short last; - unsigned short class; + unsigned int first; + unsigned int last; + unsigned int class; } classes[] = { {0x037e, 0x037e, 1}, /* Greek question mark */ @@ -2544,6 +2544,10 @@ utf_class(c) {0xff1a, 0xff20, 1}, /* half/fullwidth ASCII */ {0xff3b, 0xff40, 1}, /* half/fullwidth ASCII */ {0xff5b, 0xff65, 1}, /* half/fullwidth ASCII */ + {0x20000, 0x2a6df, 0x4e00}, /* CJK Ideographs */ + {0x2a700, 0x2b73f, 0x4e00}, /* CJK Ideographs */ + {0x2b740, 0x2b81f, 0x4e00}, /* CJK Ideographs */ + {0x2f800, 0x2fa1f, 0x4e00}, /* CJK Ideographs */ }; int bot = 0; int top = sizeof(classes) / sizeof(struct clinterval) - 1; @@ -2563,9 +2567,9 @@ utf_class(c) while (top >= bot) { mid = (bot + top) / 2; - if (classes[mid].last < c) + if (classes[mid].last < (unsigned int)c) bot = mid + 1; - else if (classes[mid].first > c) + else if (classes[mid].first > (unsigned int)c) top = mid - 1; else return (int)classes[mid].class; diff --git a/src/option.c b/src/option.c index 589e134445..4e087a58bf 100644 --- a/src/option.c +++ b/src/option.c @@ -7122,6 +7122,11 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, if (varp == &(curwin->w_s->b_p_spl)) { char_u fname[200]; + char_u *q = curwin->w_s->b_p_spl; + + /* Skip the first name if it is "cjk". */ + if (STRNCMP(q, "cjk,", 4) == 0) + q += 4; /* * Source the spell/LANG.vim in 'runtimepath'. @@ -7129,11 +7134,10 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, * Use the first name in 'spelllang' up to '_region' or * '.encoding'. */ - for (p = curwin->w_s->b_p_spl; *p != NUL; ++p) + for (p = q; *p != NUL; ++p) if (vim_strchr((char_u *)"_.,", *p) != NULL) break; - vim_snprintf((char *)fname, 200, "spell/%.*s.vim", - (int)(p - curwin->w_s->b_p_spl), curwin->w_s->b_p_spl); + vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q); source_runtime(fname, TRUE); } #endif diff --git a/src/spell.c b/src/spell.c index 2972fe9154..a16a9af526 100644 --- a/src/spell.c +++ b/src/spell.c @@ -754,9 +754,9 @@ static int did_set_spelltab; static void clear_spell_chartab __ARGS((spelltab_T *sp)); static int set_spell_finish __ARGS((spelltab_T *new_st)); static int spell_iswordp __ARGS((char_u *p, win_T *wp)); -static int spell_iswordp_nmw __ARGS((char_u *p)); +static int spell_iswordp_nmw __ARGS((char_u *p, win_T *wp)); #ifdef FEAT_MBYTE -static int spell_mb_isword_class __ARGS((int cl)); +static int spell_mb_isword_class __ARGS((int cl, win_T *wp)); static int spell_iswordp_w __ARGS((int *p, win_T *wp)); #endif static int write_spell_prefcond __ARGS((FILE *fd, garray_T *gap)); @@ -1149,7 +1149,7 @@ spell_check(wp, ptr, attrp, capcol, docount) /* When we are at a non-word character there is no error, just * skip over the character (try looking for a word after it). */ - else if (!spell_iswordp_nmw(ptr)) + else if (!spell_iswordp_nmw(ptr, wp)) { if (capcol != NULL && wp->w_s->b_cap_prog != NULL) { @@ -1561,7 +1561,7 @@ find_word(mip, mode) * accept a no-caps word, even when the dictionary * word specifies ONECAP. */ mb_ptr_back(mip->mi_word, p); - if (spell_iswordp_nmw(p) + if (spell_iswordp_nmw(p, mip->mi_win) ? capflags == WF_ONECAP : (flags & WF_ONECAP) != 0 && capflags != WF_ONECAP) @@ -4234,7 +4234,9 @@ did_set_spelllang(wp) if (spl_copy == NULL) goto theend; - /* loop over comma separated language names. */ + wp->w_s->b_cjk = 0; + + /* Loop over comma separated language names. */ for (splp = spl_copy; *splp != NUL; ) { /* Get one language name. */ @@ -4242,6 +4244,12 @@ did_set_spelllang(wp) region = NULL; len = (int)STRLEN(lang); + if (STRCMP(lang, "cjk") == 0) + { + wp->w_s->b_cjk = 1; + continue; + } + /* If the name ends in ".spl" use it as the name of the spell file. * If there is a region name let "region" point to it and remove it * from the name. */ @@ -4601,7 +4609,7 @@ captype(word, end) int past_second = FALSE; /* past second word char */ /* find first letter */ - for (p = word; !spell_iswordp_nmw(p); mb_ptr_adv(p)) + for (p = word; !spell_iswordp_nmw(p, curwin); mb_ptr_adv(p)) if (end == NULL ? *p == NUL : p >= end) return 0; /* only non-word characters, illegal word */ #ifdef FEAT_MBYTE @@ -4617,7 +4625,7 @@ captype(word, end) * But a word with an upper char only at start is a ONECAP. */ for ( ; end == NULL ? *p != NUL : p < end; mb_ptr_adv(p)) - if (spell_iswordp_nmw(p)) + if (spell_iswordp_nmw(p, curwin)) { c = PTR2CHAR(p); if (!SPELL_ISUPPER(c)) @@ -9907,7 +9915,7 @@ spell_iswordp(p, wp) c = mb_ptr2char(s); if (c > 255) - return spell_mb_isword_class(mb_get_class(s)); + return spell_mb_isword_class(mb_get_class(s), wp); return spelltab.st_isw[c]; } #endif @@ -9920,8 +9928,9 @@ spell_iswordp(p, wp) * Unlike spell_iswordp() this doesn't check for "midword" characters. */ static int -spell_iswordp_nmw(p) +spell_iswordp_nmw(p, wp) char_u *p; + win_T *wp; { #ifdef FEAT_MBYTE int c; @@ -9930,7 +9939,7 @@ spell_iswordp_nmw(p) { c = mb_ptr2char(p); if (c > 255) - return spell_mb_isword_class(mb_get_class(p)); + return spell_mb_isword_class(mb_get_class(p), wp); return spelltab.st_isw[c]; } #endif @@ -9942,11 +9951,16 @@ spell_iswordp_nmw(p) * Return TRUE if word class indicates a word character. * Only for characters above 255. * Unicode subscript and superscript are not considered word characters. + * See also dbcs_class() and utf_class() in mbyte.c. */ static int -spell_mb_isword_class(cl) - int cl; +spell_mb_isword_class(cl, wp) + int cl; + win_T *wp; { + if (wp->w_s->b_cjk) + /* East Asian characters are not considered word characters. */ + return cl == 2 || cl == 0x2800; return cl >= 2 && cl != 0x2070 && cl != 0x2080; } @@ -9971,9 +9985,10 @@ spell_iswordp_w(p, wp) if (*s > 255) { if (enc_utf8) - return spell_mb_isword_class(utf_class(*s)); + return spell_mb_isword_class(utf_class(*s), wp); if (enc_dbcs) - return dbcs_class((unsigned)*s >> 8, *s & 0xff) >= 2; + return spell_mb_isword_class( + dbcs_class((unsigned)*s >> 8, *s & 0xff), wp); return 0; } return spelltab.st_isw[*s]; @@ -10193,13 +10208,13 @@ spell_suggest(count) line = ml_get_curline(); p = line + curwin->w_cursor.col; /* Backup to before start of word. */ - while (p > line && spell_iswordp_nmw(p)) + while (p > line && spell_iswordp_nmw(p, curwin)) mb_ptr_back(line, p); /* Forward to start of word. */ - while (*p != NUL && !spell_iswordp_nmw(p)) + while (*p != NUL && !spell_iswordp_nmw(p, curwin)) mb_ptr_adv(p); - if (!spell_iswordp_nmw(p)) /* No word found. */ + if (!spell_iswordp_nmw(p, curwin)) /* No word found. */ { beep_flush(); return; @@ -10436,7 +10451,7 @@ check_need_cap(lnum, col) for (;;) { mb_ptr_back(line, p); - if (p == line || spell_iswordp_nmw(p)) + if (p == line || spell_iswordp_nmw(p, curwin)) break; if (vim_regexec(®match, p, 0) && regmatch.endp[0] == line + endcol) @@ -11645,7 +11660,7 @@ suggest_trie_walk(su, lp, fword, soundfold) /* When appending a compound word after a word character don't * use Onecap. */ - if (p != NULL && spell_iswordp_nmw(p)) + if (p != NULL && spell_iswordp_nmw(p, curwin)) c &= ~WF_ONECAP; make_case_word(tword + sp->ts_splitoff, preword + sp->ts_prewordlen, c); @@ -11895,7 +11910,8 @@ suggest_trie_walk(su, lp, fword, soundfold) * character when the word ends. But only when the * good word can end. */ if (((!try_compound && !spell_iswordp_nmw(fword - + sp->ts_fidx)) + + sp->ts_fidx, + curwin)) || fword_ends) && fword[sp->ts_fidx] != NUL && goodword_ends) @@ -14226,7 +14242,7 @@ spell_soundfold_sal(slang, inword, res) } else { - if (spell_iswordp_nmw(s)) + if (spell_iswordp_nmw(s, curwin)) *t++ = *s; ++s; } @@ -14521,7 +14537,7 @@ spell_soundfold_wsal(slang, inword, res) else { did_white = FALSE; - if (!spell_iswordp_nmw(t)) + if (!spell_iswordp_nmw(t, curwin)) continue; } } @@ -16045,7 +16061,7 @@ spell_word_start(startcol) for (p = line + startcol; p > line; ) { mb_ptr_back(line, p); - if (spell_iswordp_nmw(p)) + if (spell_iswordp_nmw(p, curwin)) break; } diff --git a/src/structs.h b/src/structs.h index 3c3fd7ba27..4186416bfd 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1310,6 +1310,9 @@ typedef struct { regprog_T *b_cap_prog; /* program for 'spellcapcheck' */ char_u *b_p_spf; /* 'spellfile' */ char_u *b_p_spl; /* 'spelllang' */ +# ifdef FEAT_MBYTE + int b_cjk; /* all CJK letters as OK */ +# endif #endif #if !defined(FEAT_SYN_HL) && !defined(FEAT_SPELL) int dummy; diff --git a/src/version.c b/src/version.c index 9b78b171dd..d8de7a949a 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 88, /**/ 87, /**/ From d37e6b872925adc47209dad97899a6f237042bdc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 04:44:01 +0100 Subject: [PATCH 074/105] Added tag v7-4-088 for changeset 853a76c7fded --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ba089ef0bb..6d7cd6fed6 100644 --- a/.hgtags +++ b/.hgtags @@ -2810,3 +2810,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 70c3289803b3129f34ffc327b113dcf152222a56 v7-4-085 60a5b7b82016da631dd7acc6121913d02c5677f8 v7-4-086 9334c994be7bb5e16a1f9c6b67e1c4342a6a386c v7-4-087 +853a76c7fdedefbc1dfdc2a4896d37a3806500e2 v7-4-088 From d6ff155e089538fc8b31eb6c30a5cc3873e8b375 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 05:12:03 +0100 Subject: [PATCH 075/105] updated for version 7.4.089 Problem: When editing a file in a directory mounted through sshfs Vim doesn't set the security context on a renamed file. Solution: Add mch_copy_sec() to vim_rename(). (Peter Backes) --- src/fileio.c | 3 +++ src/version.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/fileio.c b/src/fileio.c index 233990bf50..9db984d3fa 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6706,6 +6706,9 @@ vim_rename(from, to) #ifdef HAVE_ACL mch_set_acl(to, acl); mch_free_acl(acl); +#endif +#ifdef HAVE_SELINUX + mch_copy_sec(from, to) #endif if (errmsg != NULL) { diff --git a/src/version.c b/src/version.c index d8de7a949a..e7a9c58316 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 89, /**/ 88, /**/ From f04c34671877244fcf904a150b18ff3f29186789 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 05:12:03 +0100 Subject: [PATCH 076/105] Added tag v7-4-089 for changeset 6707c44cec61 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6d7cd6fed6..c992971109 100644 --- a/.hgtags +++ b/.hgtags @@ -2811,3 +2811,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 60a5b7b82016da631dd7acc6121913d02c5677f8 v7-4-086 9334c994be7bb5e16a1f9c6b67e1c4342a6a386c v7-4-087 853a76c7fdedefbc1dfdc2a4896d37a3806500e2 v7-4-088 +6707c44cec61d76026d5dcdd6573fb41cb89d0bd v7-4-089 From 45ba19b129fd5188539746b15066d4282dbf5bb6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 05:28:26 +0100 Subject: [PATCH 077/105] updated for version 7.4.090 Problem: Win32: When a directory name contains an exclamation mark, completion doesn't complete the contents of the directory. Solution: Escape the exclamation mark. (Jan Stocker) --- src/ex_getln.c | 4 ++-- src/testdir/Make_amiga.mak | 3 ++- src/testdir/Make_dos.mak | 2 +- src/testdir/Make_ming.mak | 2 +- src/testdir/Make_os2.mak | 2 +- src/testdir/Make_vms.mms | 4 ++-- src/testdir/Makefile | 2 +- src/testdir/test102.in | 12 ++++++++++++ src/testdir/test102.ok | 3 +++ src/version.c | 2 ++ 10 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 src/testdir/test102.in create mode 100644 src/testdir/test102.ok diff --git a/src/ex_getln.c b/src/ex_getln.c index 906eb8bb0c..f1f39d2dcf 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -3852,9 +3852,9 @@ vim_strsave_fnameescape(fname, shell) char_u buf[20]; int j = 0; - /* Don't escape '[' and '{' if they are in 'isfname'. */ + /* Don't escape '[', '{' and '!' if they are in 'isfname'. */ for (p = PATH_ESC_CHARS; *p != NUL; ++p) - if ((*p != '[' && *p != '{') || !vim_isfilec(*p)) + if ((*p != '[' && *p != '{' && *p != '!') || !vim_isfilec(*p)) buf[j++] = *p; buf[j] = NUL; p = vim_strsave_escaped(fname, buf); diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 8842131b92..c1d4e9d218 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -34,7 +34,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out test100.out test101.out + test99.out test100.out test101.out test102.out .SUFFIXES: .in .out @@ -152,3 +152,4 @@ test98.out: test98.in test99.out: test99.in test100.out: test100.in test101.out: test101.in +test102.out: test102.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 38208e748c..40e0404194 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -33,7 +33,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100.out test101.out + test100.out test101.out test102.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index 9ec1f06e64..16944fe0e8 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -53,7 +53,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100out test101.out + test100out test101.out test102.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index 823a706fab..38b566292a 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -35,7 +35,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100.out test101.out + test100.out test101.out test102.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 2626b5bb9b..359f4cb245 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2013 Nov 08 +# Last change: 2013 Nov 12 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -79,7 +79,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test82.out test83.out test84.out test88.out test89.out \ test90.out test91.out test92.out test93.out test94.out \ test95.out test96.out test97.out test98.out test99.out \ - test100.out test101.out + test100.out test101.out test102.out # Known problems: # Test 30: a problem around mac format - unknown reason diff --git a/src/testdir/Makefile b/src/testdir/Makefile index aa3777c92c..afff509796 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -30,7 +30,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out test100.out test101.out + test99.out test100.out test101.out test102.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test102.in b/src/testdir/test102.in new file mode 100644 index 0000000000..35e9f6c2cf --- /dev/null +++ b/src/testdir/test102.in @@ -0,0 +1,12 @@ +Test if fnameescape is correct for special chars like ! + +STARTTEST +:%d +:let fname = 'Xspa ce' +:try | exe "w! " . fnameescape(fname) | put='Space' | endtry +:let fname = 'Xemark!' +:try | exe "w! " . fnameescape(fname) | put='ExclamationMark' | endtry +:w! test.out +:qa! +ENDTEST + diff --git a/src/testdir/test102.ok b/src/testdir/test102.ok new file mode 100644 index 0000000000..a25fea192c --- /dev/null +++ b/src/testdir/test102.ok @@ -0,0 +1,3 @@ + +Space +ExclamationMark diff --git a/src/version.c b/src/version.c index e7a9c58316..41d07404cc 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 90, /**/ 89, /**/ From e2c2f905017c000198d1de0bac4bfeedea3b01f6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 05:28:26 +0100 Subject: [PATCH 078/105] Added tag v7-4-090 for changeset 31217cc48e7d --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c992971109..ba4393ef4b 100644 --- a/.hgtags +++ b/.hgtags @@ -2812,3 +2812,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 9334c994be7bb5e16a1f9c6b67e1c4342a6a386c v7-4-087 853a76c7fdedefbc1dfdc2a4896d37a3806500e2 v7-4-088 6707c44cec61d76026d5dcdd6573fb41cb89d0bd v7-4-089 +31217cc48e7d8c9aca703688d3d04d8edbc85bba v7-4-090 From b2636263db9f0427830195a240aee5aa8517d8a1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 18:09:29 +0100 Subject: [PATCH 079/105] updated for version 7.4.091 Problem: Missing semicolon. Solution: Add the semicolon. --- src/fileio.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index 9db984d3fa..1d030165a0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6708,7 +6708,7 @@ vim_rename(from, to) mch_free_acl(acl); #endif #ifdef HAVE_SELINUX - mch_copy_sec(from, to) + mch_copy_sec(from, to); #endif if (errmsg != NULL) { diff --git a/src/version.c b/src/version.c index 41d07404cc..0e9375a303 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 91, /**/ 90, /**/ From c6425e6e4ba0ebdd858206138180e4b1240e27f2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Nov 2013 18:09:29 +0100 Subject: [PATCH 080/105] Added tag v7-4-091 for changeset 9502d1caf90b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ba4393ef4b..b37510dccb 100644 --- a/.hgtags +++ b/.hgtags @@ -2813,3 +2813,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 853a76c7fdedefbc1dfdc2a4896d37a3806500e2 v7-4-088 6707c44cec61d76026d5dcdd6573fb41cb89d0bd v7-4-089 31217cc48e7d8c9aca703688d3d04d8edbc85bba v7-4-090 +9502d1caf90bf56f0125c99b7d17ba70944ebd85 v7-4-091 From c1f9bc0fd38e6aedb896d5e6d62e229f8b712ef3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 14 Nov 2013 03:54:07 +0100 Subject: [PATCH 081/105] updated for version 7.4.092 Problem: Can't build small version. Solution: Add #ifdef where the b_cjk flag is used. (Ken Takata) --- src/spell.c | 4 ++++ src/version.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/spell.c b/src/spell.c index a16a9af526..6e0d986d7c 100644 --- a/src/spell.c +++ b/src/spell.c @@ -4234,7 +4234,9 @@ did_set_spelllang(wp) if (spl_copy == NULL) goto theend; +#ifdef FEAT_MBYTE wp->w_s->b_cjk = 0; +#endif /* Loop over comma separated language names. */ for (splp = spl_copy; *splp != NUL; ) @@ -4246,7 +4248,9 @@ did_set_spelllang(wp) if (STRCMP(lang, "cjk") == 0) { +#ifdef FEAT_MBYTE wp->w_s->b_cjk = 1; +#endif continue; } diff --git a/src/version.c b/src/version.c index 0e9375a303..24a3e8b210 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 92, /**/ 91, /**/ From 0c870b1f144402b8647ea13ac7161b28ee018890 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 14 Nov 2013 03:54:07 +0100 Subject: [PATCH 082/105] Added tag v7-4-092 for changeset 1b4cb2c6b285 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index b37510dccb..ae00c8d8ad 100644 --- a/.hgtags +++ b/.hgtags @@ -2814,3 +2814,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 6707c44cec61d76026d5dcdd6573fb41cb89d0bd v7-4-089 31217cc48e7d8c9aca703688d3d04d8edbc85bba v7-4-090 9502d1caf90bf56f0125c99b7d17ba70944ebd85 v7-4-091 +1b4cb2c6b285265da4ffbe242af35a73e1b118e6 v7-4-092 From 99151b741400cf4e6563e38def8c6181719c1bd7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 14 Nov 2013 05:48:46 +0100 Subject: [PATCH 083/105] Update runtime files. --- runtime/doc/index.txt | 3 +- runtime/doc/options.txt | 2 +- runtime/doc/pattern.txt | 2 +- runtime/doc/spell.txt | 2 +- runtime/doc/tags | 3 + runtime/doc/todo.txt | 40 +++----------- runtime/filetype.vim | 5 +- runtime/syntax/masm.vim | 104 +++++++++++++++++++++-------------- runtime/syntax/mix.vim | 83 ++++++++++++++++++++++++++++ runtime/tutor/tutor.it | 2 +- runtime/tutor/tutor.it.utf-8 | 2 +- 11 files changed, 166 insertions(+), 82 deletions(-) create mode 100644 runtime/syntax/mix.vim diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 49f28f30a8..68dceb943a 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.4. Last change: 2013 Oct 01 +*index.txt* For Vim version 7.4. Last change: 2013 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1275,6 +1275,7 @@ tag command action ~ |:keepalt| :keepa[lt] following command keeps the alternate file |:keepmarks| :kee[pmarks] following command keeps marks where they are |:keepjumps| :keepj[umps] following command keeps jumplist and marks +|:keeppatterns| :keepp[atterns] following command keeps search pattern history |:lNext| :lN[ext] go to previous entry in location list |:lNfile| :lNf[ile] go to last entry in previous file |:list| :l[ist] print lines diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index a515900291..b7b66495e1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2013 Nov 06 +*options.txt* For Vim version 7.4. Last change: 2013 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index edbeafde17..f2f0b34e32 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.4. Last change: 2013 Jul 06 +*pattern.txt* For Vim version 7.4. Last change: 2013 Nov 09 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index d2dde05ec4..a39bec9051 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 7.4. Last change: 2013 Jul 17 +*spell.txt* For Vim version 7.4. Last change: 2013 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tags b/runtime/doc/tags index 73475a9d69..755f993c8c 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2300,6 +2300,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :keepj motion.txt /*:keepj* :keepjumps motion.txt /*:keepjumps* :keepmarks motion.txt /*:keepmarks* +:keepp cmdline.txt /*:keepp* +:keeppatterns cmdline.txt /*:keeppatterns* :l various.txt /*:l* :lN quickfix.txt /*:lN* :lNext quickfix.txt /*:lNext* @@ -7791,6 +7793,7 @@ spell-affix-flags spell.txt /*spell-affix-flags* spell-affix-mbyte spell.txt /*spell-affix-mbyte* spell-affix-not-supported spell.txt /*spell-affix-not-supported* spell-affix-vim spell.txt /*spell-affix-vim* +spell-cjk spell.txt /*spell-cjk* spell-compound spell.txt /*spell-compound* spell-dic-format spell.txt /*spell-dic-format* spell-double-scoring spell.txt /*spell-double-scoring* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 512a3827e5..641af1c321 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2013 Nov 09 +*todo.txt* For Vim version 7.4. Last change: 2013 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -80,9 +80,6 @@ Await response from maintainer. Include systemverilog file? Two votes yes. -Patch to add :keeppatterns, don't put used search patterns in history. -(Christian Brabandt, 2013 Oct 18) - Problem with 'spellsuggest' file, only works for some words. (Cesar Romani, 2013 Aug 20) Depends on file name? (Aug 24) Additional remark by glts: the suggested words are marked bad? @@ -93,45 +90,19 @@ Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Issue 174: Detect Mason files. -Patch for Python: Fix interrupt not being properly discarded in VimTryEnd. -With tests. (ZyX, 2013 Oct 19) Reported by Yggdroot Chen. - Patch to make has() check for Vim version and patch at the same time. (Marc Weber, 2013 Jun 7) -Patch to fix Visual-block insert using cursor keys. (Christian Brabandt, 2013 -Sep 28) With test Sept 29. - VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow instead. (Samuel Ferencik, 2013 Sep 28) -Series of patches for NL vs NUL handling. (ZyX, 2013 Nov 3) +Series of patches for NL vs NUL handling. (ZyX, 2013 Nov 3, Nov 9) Perl: support for Activestate perl 5.18: Issue 170. -Bug: Does not skip over expression with dict member properly. (ZyX, 2013 Sep -29) -Patch to fix expr7() when skipping. (2013 Oct 15) Oct 23 with test. - Several syntax file match "^\s*" which may get underlined if that's in the highlight group. Add a "\zs" after it? -- Have an option for spell checking to not mark any Chinese, Japanese or - other double-width characters (or CJK characters) as error. - Helps a lot for mixed Asian and latin text. - More general: Have some way not to give spelling errors for a range of - characters. -Patch to add "cjk" to 'spelllang'. (Ken Takata, 2013 Oct 8, second one) - -Patch to add mch_copy_sec() to vim_rename(). -bug report on redhat. (Peter Backes, 2013 oct 8) -Patch to vim-dev, 2013 Oct 9. - -Win32: When a directory name contains an exclamation mark, completion doesn't -complete the contents of the directory. No escaping for the "!"? (Jan -Stocker, 2012 Jan 5; 2013 Aug 20) -Patch 2013 Sept 10, test: Sept 11. - Go through more coverity reports. Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24) @@ -148,6 +119,7 @@ With "$" in 'cpoptions' the popup menu isn't fully drawn. (Matti Niemenmaa, "gUgn" cannot be repeated, while "dgn" can. (Dimitar Dimitrov) Patch by Christian Brabandt (2013 Aug 12) +Also notes by Christian Wellenbrock, Nov 13. Several Win32 functions are not using Unicode. Patches to fix this. (Ken Takata, 2013 Aug 9) @@ -223,7 +195,7 @@ carried over when using :global. (Christian Brabandt, 2013 Jun 19) Bug with 'cursorline' in diff mode. Line being scrolled into view gets highlighted as the cursor line. (Alessandro Ivaldi, 2013 Jun 4) -Two highlighting bugs. (Zyx, 2013 Aug 18) +Two highlighting bugs. (ZyX, 2013 Aug 18) Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5) May 17: with winlist() and tabpagelist(). @@ -980,7 +952,7 @@ Session file generates error upon loading, cause by --remote-silent-tab. Using ~ works OK on 'a' with composing char, but not on 0x0418 with composing char 0x0301. (Tony Mechelynck, 2009 Mar 4) -A function on a dictionary is not profiled. (Zyx, 2010 Dec 25) +A function on a dictionary is not profiled. (ZyX, 2010 Dec 25) Inconsistent: starting with $LANG set to es_ES.utf-8 gives Spanish messages, even though locale is not supported. But ":lang messages @@ -1426,6 +1398,8 @@ Check for this and use iconv? (Edward L. Fox, 2007 Sep 12) Does the conversion in the other direction work when 'fileencodings' is set properly? +Add a few features to xxd. (Vadim Vygonets, 2013 Nov 11) + Cursor displayed in the wrong position when using 'numberwidth'. (James Vega, 2007 Jun 21) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index f5ece17287..20775e9d21 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2013 Oct 06 +" Last Change: 2013 Nov 13 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -1172,6 +1172,9 @@ au BufNewFile,BufRead *.mp setf mp " MGL au BufNewFile,BufRead *.mgl setf mgl +" MIX - Knuth assembly +au BufNewFile,BufRead *.mix,*.mixal setf mix + " MMIX or VMS makefile au BufNewFile,BufRead *.mms call s:FTmms() diff --git a/runtime/syntax/masm.vim b/runtime/syntax/masm.vim index 1711601f32..bb3c9681bc 100644 --- a/runtime/syntax/masm.vim +++ b/runtime/syntax/masm.vim @@ -2,14 +2,11 @@ " Language: Microsoft Macro Assembler (80x86) " Orig Author: Rob Brady " Maintainer: Wu Yongwei -" Last Change: $Date: 2012/02/04 12:45:39 $ -" $Revision: 1.46 $ +" Last Change: $Date: 2013/11/13 11:49:24 $ +" $Revision: 1.48 $ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" Quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -194,6 +191,10 @@ syn keyword masmRegister R8D R9D R10D R11D R12D R13D R14D R15D syn keyword masmRegister R8W R9W R10W R11W R12W R13W R14W R15W syn keyword masmRegister R8B R9B R10B R11B R12B R13B R14B R15B +" SSE/AVX registers +syn match masmRegister "\(X\|Y\)MM[0-9]\>" +syn match masmRegister "\(X\|Y\)MM1[0-5]\>" + " Instruction prefixes syn keyword masmOpcode LOCK REP REPE REPNE REPNZ REPZ @@ -302,50 +303,69 @@ syn keyword masmOpcode FISTTP LDDQU ADDSUBPS ADDSUBPD syn keyword masmOpcode HADDPS HSUBPS HADDPD HSUBPD syn keyword masmOpcode MOVSHDUP MOVSLDUP MOVDDUP MONITOR MWAIT +" SSSE3 opcodes (Core and later) +syn keyword masmOpcode PSIGNB PSIGNW PSIGND PABSB PABSW PABSD +syn keyword masmOpcode PALIGNR PSHUFB PMULHRSW PMADDUBSW +syn keyword masmOpcode PHSUBW PHSUBD PHSUBSW PHADDW PHADDD PHADDSW + +" SSE 4.1 opcodes (Penryn and later) +syn keyword masmOpcode MPSADBW PHMINPOSUW PMULDQ PMULLD DPPS DPPD +syn keyword masmOpcode BLENDPS BLENDPD BLENDVPS BLENDVPD +syn keyword masmOpcode PBLENDVB PBLENDW +syn keyword masmOpcode PMINSB PMAXSB PMINSD PMAXSD +syn keyword masmOpcode PMINUW PMAXUW PMINUD PMAXUD +syn keyword masmOpcode ROUNDPS ROUNDSS ROUNDPD ROUNDSD +syn keyword masmOpcode INSERTPS PINSRB PINSRD PINSRQ +syn keyword masmOpcode EXTRACTPS PEXTRB PEXTRD PEXTRQ +syn keyword masmOpcode PMOVSXBW PMOVZXBW PMOVSXBD PMOVZXBD +syn keyword masmOpcode PMOVSXBQ PMOVZXBQ PMOVSXWD PMOVZXWD +syn keyword masmOpcode PMOVSXWQ PMOVZXWQ PMOVSXDQ PMOVZXDQ +syn keyword masmOpcode PTEST PCMPEQQ PACKUSDW MOVNTDQA + +" SSE 4.2 opcodes (Nehalem and later) +syn keyword masmOpcode PCMPESTRI PCMPESTRM PCMPISTRI PCMPISTRM PCMPGTQ +syn keyword masmOpcode CRC32 POPCNT LZCNT + +" AES-NI (Westmere (2010) and later) +syn keyword masmOpcode AESENC AESENCLAST AESDEC AESDECLAST +syn keyword masmOpcode AESKEYGENASSIST AESIMC PCLMULQDQ + +" AVX (Sandy Bridge (2011) and later) +syn keyword masmOpcode VBROADCASTSS VBROADCASTSD VBROADCASTF128 +syn keyword masmOpcode VINSERTF128 VEXTRACTF128 VMASKMOVPS VMASKMOVPD +syn keyword masmOpcode VPERMILPS VPERMILPD VPERM2F128 +syn keyword masmOpcode VZEROALL VZEROUPPER + " Other opcodes in Pentium and later processors syn keyword masmOpcode CMPXCHG8B CPUID UD2 syn keyword masmOpcode RSM RDMSR WRMSR RDPMC RDTSC SYSENTER SYSEXIT syn match masmOpcode "CMOV\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>" -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_masm_syntax_inits") - if version < 508 - let did_masm_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" The default highlighting +hi def link masmLabel PreProc +hi def link masmComment Comment +hi def link masmDirective Statement +hi def link masmType Type +hi def link masmOperator Type +hi def link masmOption Special +hi def link masmRegister Special +hi def link masmString String +hi def link masmText String +hi def link masmTitle Title +hi def link masmOpcode Statement +hi def link masmOpFloat Statement - " The default methods for highlighting. Can be overridden later - HiLink masmLabel PreProc - HiLink masmComment Comment - HiLink masmDirective Statement - HiLink masmType Type - HiLink masmOperator Type - HiLink masmOption Special - HiLink masmRegister Special - HiLink masmString String - HiLink masmText String - HiLink masmTitle Title - HiLink masmOpcode Statement - HiLink masmOpFloat Statement +hi def link masmHexadecimal Number +hi def link masmDecimal Number +hi def link masmOctal Number +hi def link masmBinary Number +hi def link masmFloatRaw Number +hi def link masmFloat Number - HiLink masmHexadecimal Number - HiLink masmDecimal Number - HiLink masmOctal Number - HiLink masmBinary Number - HiLink masmFloatRaw Number - HiLink masmFloat Number +hi def link masmIdentifier Identifier - HiLink masmIdentifier Identifier - - syntax sync minlines=50 - - delcommand HiLink -endif +syntax sync minlines=50 let b:current_syntax = "masm" diff --git a/runtime/syntax/mix.vim b/runtime/syntax/mix.vim new file mode 100644 index 0000000000..9ab98eacf8 --- /dev/null +++ b/runtime/syntax/mix.vim @@ -0,0 +1,83 @@ +" Vim syntax file +" Language: MIX (Donald Knuth's assembly language used in TAOCP) +" Maintainer: Wu Yongwei +" Filenames: *.mixal *.mix +" Last Change: 2013 Nov 13 + +" Quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn case ignore + +" Special processing of ALF directive: implementations vary whether quotation +" marks are needed +syn match mixAlfParam #\s\{1,2\}"\?[^"]\{,5\}"\?# contains=mixAlfDirective,mixString nextgroup=mixEndComment contained + +" Region for parameters +syn match mixParam #[-+*/:=0-9a-z,()"]\+# contains=mixIdentifier,mixSpecial,mixNumber,mixString,mixLabel nextgroup=mixEndComment contained + +" Comment at the line end +syn match mixEndComment ".*" contains=mixRegister contained + +" Identifier; must go before literals +syn match mixIdentifier "[a-z0-9_]\+" contained + +" Literals +syn match mixSpecial "[-+*/:=]" contained +syn match mixNumber "[0-9]\+\>" contained +syn region mixString start=+"+ skip=+\\"+ end=+"+ contained + +" Labels +syn match mixLabel "^[a-z0-9_]\{,10\}\s\+" nextgroup=mixAlfSpecial,mixOpcode,mixDirective +syn match mixLabel "[0-9][BF]" contained + +" Comments +syn match mixComment "^\*.*" contains=mixRegister + +" Directives +syn keyword mixDirective ORIG EQU CON END nextgroup=mixParam contained skipwhite +syn keyword mixDirective ALF nextgroup=mixAlfParam contained + +" Opcodes +syn keyword mixOpcode NOP HLT NUM CHAR FLOT FIX nextgroup=mixEndComment contained +syn keyword mixOpcode FADD FSUB FMUL FDIV FCMP MOVE ADD SUB MUL DIV IOC IN OUT JRED JBUS JMP JSJ JOV JNOV JL JE JG JLE JNE JGE SLA SRA SLAX SRAX SLC SRC nextgroup=mixParam contained skipwhite + +syn match mixOpcode "LD[AX1-6]N\?\>" nextgroup=mixParam contained skipwhite +syn match mixOpcode "ST[AX1-6JZ]\>" nextgroup=mixParam contained skipwhite +syn match mixOpcode "EN[TN][AX1-6]\>" nextgroup=mixParam contained skipwhite +syn match mixOpcode "INC[AX1-6]\>" nextgroup=mixParam contained skipwhite +syn match mixOpcode "DEC[AX1-6]\>" nextgroup=mixParam contained skipwhite +syn match mixOpcode "CMP[AX1-6]\>" nextgroup=mixParam contained skipwhite +syn match mixOpcode "J[AX1-6]N\?[NZP]\>" nextgroup=mixParam contained skipwhite + +" Switch back to being case sensitive +syn case match + +" Registers (only to used in comments now) +syn keyword mixRegister rA rX rI1 rI2 rI3 rI4 rI5 rI6 rJ contained + +" The default highlighting +hi def link mixRegister Special +hi def link mixLabel Define +hi def link mixComment Comment +hi def link mixEndComment Comment +hi def link mixDirective Keyword +hi def link mixOpcode Keyword + +hi def link mixSpecial Special +hi def link mixNumber Number +hi def link mixString String +hi def link mixAlfParam String +hi def link mixIdentifier Identifier + +let b:current_syntax = "mix" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 diff --git a/runtime/tutor/tutor.it b/runtime/tutor/tutor.it index 69e83eb03d..8fd13268f6 100644 --- a/runtime/tutor/tutor.it +++ b/runtime/tutor/tutor.it @@ -638,7 +638,7 @@ NOTA: Tutti i comandi : devono essere terminati premendo NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto sar una copia esatta di "tutor.it" al momento del salvataggio. - 5. Ora cancella il file battendo (MR-DOS): :!del TEST + 5. Ora cancella il file battendo (MS-DOS): :!del TEST o (Unix): :!rm TEST diff --git a/runtime/tutor/tutor.it.utf-8 b/runtime/tutor/tutor.it.utf-8 index bee3f6d8f2..076aac3e6a 100644 --- a/runtime/tutor/tutor.it.utf-8 +++ b/runtime/tutor/tutor.it.utf-8 @@ -638,7 +638,7 @@ NOTA: Tutti i comandi : devono essere terminati premendo NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto sarà una copia esatta di "tutor.it" al momento del salvataggio. - 5. Ora cancella il file battendo (MR-DOS): :!del TEST + 5. Ora cancella il file battendo (MS-DOS): :!del TEST o (Unix): :!rm TEST From b52c006ea07dae786c087943792aa95a5b971fe9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Nov 2013 20:17:12 +0100 Subject: [PATCH 084/105] updated for version 7.4.093 Problem: Configure can't use LuaJIT on ubuntu 12.04. Solution: Adjust the configure regexp that locates the version number. (Charles Strahan) --- src/auto/configure | 2 +- src/configure.in | 2 +- src/version.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 63da09823f..5a205966e5 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4743,7 +4743,7 @@ $as_echo_n "checking LuaJIT version... " >&6; } if test "${vi_cv_version_luajit+set}" = set; then : $as_echo_n "(cached) " >&6 else - vi_cv_version_luajit=`${vi_cv_path_luajit} -v | sed 's/LuaJIT \([0-9.]*\)\.[0-9] .*/\1/'` + vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-[a-z0-9]\+\)\? .*/\1/'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_luajit" >&5 $as_echo "$vi_cv_version_luajit" >&6; } diff --git a/src/configure.in b/src/configure.in index 8f0dce4c3e..83d0ea880e 100644 --- a/src/configure.in +++ b/src/configure.in @@ -496,7 +496,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then if test "X$vi_cv_path_luajit" != "X"; then dnl -- find LuaJIT version AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit, - [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]] .*/\1/'` ]) + [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]\+\)\? .*/\1/'` ]) AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit, [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ]) vi_cv_path_lua="$vi_cv_path_luajit" diff --git a/src/version.c b/src/version.c index 24a3e8b210..9552bba4e6 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 93, /**/ 92, /**/ From c1b6ef1859b892940996ab031ca5bba7f92589db Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Nov 2013 20:17:12 +0100 Subject: [PATCH 085/105] Added tag v7-4-093 for changeset 33f3e277ceab --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ae00c8d8ad..30954cf363 100644 --- a/.hgtags +++ b/.hgtags @@ -2815,3 +2815,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 31217cc48e7d8c9aca703688d3d04d8edbc85bba v7-4-090 9502d1caf90bf56f0125c99b7d17ba70944ebd85 v7-4-091 1b4cb2c6b285265da4ffbe242af35a73e1b118e6 v7-4-092 +33f3e277ceab43179c74093f68196bd370199dbc v7-4-093 From 43b5c29a9313ecf8c166bda1bbbb83e610f305ee Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Nov 2013 20:32:54 +0100 Subject: [PATCH 086/105] updated for version 7.4.094 Problem: Configure may not find that -lint is needed for gettext(). Solution: Check for gettext() with empty $LIBS. (Thomas De Schampheleire) --- src/auto/configure | 10 ++++++---- src/configure.in | 13 +++++++++---- src/version.c | 2 ++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 5a205966e5..472afcb425 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -12690,6 +12690,8 @@ $as_echo_n "checking for NLS... " >&6; } if test -f po/Makefile; then have_gettext="no" if test -n "$MSGFMT"; then + olibs=$LIBS + LIBS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -12703,10 +12705,9 @@ gettext("Test"); _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: gettext() works" >&5 -$as_echo "gettext() works" >&6; }; have_gettext="yes" +$as_echo "gettext() works" >&6; }; have_gettext="yes"; LIBS=$olibs else - olibs=$LIBS - LIBS="$LIBS -lintl" + LIBS="-lintl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -12720,7 +12721,8 @@ gettext("Test"); _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: gettext() works with -lintl" >&5 -$as_echo "gettext() works with -lintl" >&6; }; have_gettext="yes" +$as_echo "gettext() works with -lintl" >&6; }; have_gettext="yes"; + LIBS="$olibs -lintl" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: gettext() doesn't work" >&5 $as_echo "gettext() doesn't work" >&6; }; diff --git a/src/configure.in b/src/configure.in index 83d0ea880e..9af3f2475d 100644 --- a/src/configure.in +++ b/src/configure.in @@ -3725,6 +3725,9 @@ if test "$MANDEF" = "man -s"; then fi dnl Check if gettext() is working and if it needs -lintl +dnl We take care to base this on an empty LIBS: on some systems libelf would be +dnl in LIBS and implicitly take along libintl. The final LIBS would then not +dnl contain libintl, and the link step would fail due to -Wl,--as-needed. AC_MSG_CHECKING(--disable-nls argument) AC_ARG_ENABLE(nls, [ --disable-nls Don't support NLS (gettext()).], , @@ -3743,16 +3746,18 @@ if test "$enable_nls" = "yes"; then if test -f po/Makefile; then have_gettext="no" if test -n "$MSGFMT"; then + olibs=$LIBS + LIBS="" AC_TRY_LINK( [#include ], [gettext("Test");], - AC_MSG_RESULT([gettext() works]); have_gettext="yes", - olibs=$LIBS - LIBS="$LIBS -lintl" + AC_MSG_RESULT([gettext() works]); have_gettext="yes"; LIBS=$olibs, + LIBS="-lintl" AC_TRY_LINK( [#include ], [gettext("Test");], - AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes", + AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes"; + LIBS="$olibs -lintl", AC_MSG_RESULT([gettext() doesn't work]); LIBS=$olibs)) else diff --git a/src/version.c b/src/version.c index 9552bba4e6..66496f8eb5 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 94, /**/ 93, /**/ From 2247036812550eb57e3a2fd762beadf049be5702 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Nov 2013 20:32:54 +0100 Subject: [PATCH 087/105] Added tag v7-4-094 for changeset 68b5f8abca93 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 30954cf363..8cb3ecb8c6 100644 --- a/.hgtags +++ b/.hgtags @@ -2816,3 +2816,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 9502d1caf90bf56f0125c99b7d17ba70944ebd85 v7-4-091 1b4cb2c6b285265da4ffbe242af35a73e1b118e6 v7-4-092 33f3e277ceab43179c74093f68196bd370199dbc v7-4-093 +68b5f8abca93dd035ba180aa673a5bbf035b89db v7-4-094 From 111e89e256942105c8b67988742d7f64880ecf74 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 12:17:51 +0100 Subject: [PATCH 088/105] updated for version 7.4.095 Problem: Regexp for LuaJIT version doesn't work on BSD. Solution: Use "*" instead of "\+" and "\?". (Ozaki) --- src/auto/configure | 2 +- src/configure.in | 2 +- src/version.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 472afcb425..32731fe1d7 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4743,7 +4743,7 @@ $as_echo_n "checking LuaJIT version... " >&6; } if test "${vi_cv_version_luajit+set}" = set; then : $as_echo_n "(cached) " >&6 else - vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-[a-z0-9]\+\)\? .*/\1/'` + vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-[a-z0-9]*\)* .*/\1/'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_luajit" >&5 $as_echo "$vi_cv_version_luajit" >&6; } diff --git a/src/configure.in b/src/configure.in index 9af3f2475d..2718d31521 100644 --- a/src/configure.in +++ b/src/configure.in @@ -496,7 +496,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then if test "X$vi_cv_path_luajit" != "X"; then dnl -- find LuaJIT version AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit, - [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]\+\)\? .*/\1/'` ]) + [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]*\)* .*/\1/'` ]) AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit, [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ]) vi_cv_path_lua="$vi_cv_path_luajit" diff --git a/src/version.c b/src/version.c index 66496f8eb5..f4a60690ae 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 95, /**/ 94, /**/ From e2b21289999e23be0779c6b54073b28eade1e585 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 12:17:52 +0100 Subject: [PATCH 089/105] Added tag v7-4-095 for changeset acbe5414cb7f --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8cb3ecb8c6..153cabad23 100644 --- a/.hgtags +++ b/.hgtags @@ -2817,3 +2817,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 1b4cb2c6b285265da4ffbe242af35a73e1b118e6 v7-4-092 33f3e277ceab43179c74093f68196bd370199dbc v7-4-093 68b5f8abca93dd035ba180aa673a5bbf035b89db v7-4-094 +acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 From 361cf1efdfdc29ed3652533d6b8250cec76c79ec Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 12:34:11 +0100 Subject: [PATCH 090/105] updated for version 7.4.096 Problem: Can't change directory to an UNC path. Solution: Use win32_getattrs() in mch_getperm(). (Christian Brabandt) --- src/os_win32.c | 15 ++++++++------- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/os_win32.c b/src/os_win32.c index cd29b8738a..413dbfa0b9 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -2841,18 +2841,20 @@ mch_dirname( } /* - * get file permissions for `name' - * -1 : error - * else mode_t + * Get file permissions for "name". + * Return mode_t or -1 for error. */ long mch_getperm(char_u *name) { struct stat st; - int n; + int n; + if (name[0] == '\\' && name[1] == '\\') + /* UNC path */ + return (long)win32_getattrs(name); n = mch_stat(name, &st); - return n == 0 ? (int)st.st_mode : -1; + return n == 0 ? (long)st.st_mode : -1L; } @@ -3094,8 +3096,7 @@ win32_fileinfo(char_u *fname, BY_HANDLE_FILE_INFORMATION *info) * -1 : error * else FILE_ATTRIBUTE_* defined in winnt.h */ - static - int + static int win32_getattrs(char_u *name) { int attr; diff --git a/src/version.c b/src/version.c index f4a60690ae..89e6e11339 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 96, /**/ 95, /**/ From 57eef40365d9c780e1fa6332bbc0d72864fecd01 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 12:34:11 +0100 Subject: [PATCH 091/105] Added tag v7-4-096 for changeset 645358801356 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 153cabad23..61597fb578 100644 --- a/.hgtags +++ b/.hgtags @@ -2818,3 +2818,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 33f3e277ceab43179c74093f68196bd370199dbc v7-4-093 68b5f8abca93dd035ba180aa673a5bbf035b89db v7-4-094 acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 +645358801356c7b1c53a1d3b1543781a669a7733 v7-4-096 From 0f8f699c2c1e1bb93fd3255e8e97f38ab536c386 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 13:24:41 +0100 Subject: [PATCH 092/105] updated for version 7.4.097 Problem: Unexpected behavior change related to 'virtualedit'. (Ingo Karkat) Solution: Update the valid cursor position. (Christian Brabandt) --- src/ops.c | 4 ++++ src/version.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/ops.c b/src/ops.c index bf65191899..e1048c2554 100644 --- a/src/ops.c +++ b/src/ops.c @@ -3844,7 +3844,11 @@ do_put(regname, dir, count, flags) ml_replace(lnum, newp, FALSE); /* Place cursor on last putted char. */ if (lnum == curwin->w_cursor.lnum) + { + /* make sure curwin->w_virtcol is updated */ + changed_cline_bef_curs(); curwin->w_cursor.col += (colnr_T)(totlen - 1); + } } #ifdef FEAT_VISUAL if (VIsual_active) diff --git a/src/version.c b/src/version.c index 89e6e11339..739b63e638 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 97, /**/ 96, /**/ From 7272b4dd1ede93132a9091f0188720dad9f87626 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 13:24:41 +0100 Subject: [PATCH 093/105] Added tag v7-4-097 for changeset 93c8296281dd --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 61597fb578..f2eb8f3175 100644 --- a/.hgtags +++ b/.hgtags @@ -2819,3 +2819,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 68b5f8abca93dd035ba180aa673a5bbf035b89db v7-4-094 acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 645358801356c7b1c53a1d3b1543781a669a7733 v7-4-096 +93c8296281dd64e513d52db9f745965926df5cab v7-4-097 From 909c88c543773213de02e1a32ca6e4793fe0cff3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 14:21:40 +0100 Subject: [PATCH 094/105] updated for version 7.4.098 Problem: When using ":'<,'>del" errors may be given for the visual line numbers being out of range. Solution: Reset Visual mode in ":del". (Lech Lorens) --- src/ex_docmd.c | 5 +++++ src/testdir/Make_amiga.mak | 3 ++- src/testdir/Make_dos.mak | 2 +- src/testdir/Make_ming.mak | 2 +- src/testdir/Make_os2.mak | 2 +- src/testdir/Make_vms.mms | 4 ++-- src/testdir/Makefile | 2 +- src/testdir/test103.in | 37 +++++++++++++++++++++++++++++++++++++ src/testdir/test103.ok | 2 ++ src/version.c | 2 ++ 10 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 src/testdir/test103.in create mode 100644 src/testdir/test103.ok diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 1c700d4735..ff5a6df9a6 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8570,6 +8570,11 @@ ex_operators(eap) beginline(BL_SOL | BL_FIX); } +#if defined(FEAT_VISUAL) + if (VIsual_active) + end_visual_mode(); +#endif + switch (eap->cmdidx) { case CMD_delete: diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index c1d4e9d218..0fd1e86891 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -34,7 +34,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out test100.out test101.out test102.out + test99.out test100.out test101.out test102.out test103.out .SUFFIXES: .in .out @@ -153,3 +153,4 @@ test99.out: test99.in test100.out: test100.in test101.out: test101.in test102.out: test102.in +test103.out: test103.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 40e0404194..05e1422470 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -33,7 +33,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100.out test101.out test102.out + test100.out test101.out test102.out test103.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index 16944fe0e8..da6d5e8dc7 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -53,7 +53,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100out test101.out test102.out + test100out test101.out test102.out test103.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index 38b566292a..7af826d361 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -35,7 +35,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test81.out test82.out test83.out test84.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test98.out test99.out \ - test100.out test101.out test102.out + test100.out test101.out test102.out test103.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 359f4cb245..370406145e 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2013 Nov 12 +# Last change: 2013 Nov 21 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -79,7 +79,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test82.out test83.out test84.out test88.out test89.out \ test90.out test91.out test92.out test93.out test94.out \ test95.out test96.out test97.out test98.out test99.out \ - test100.out test101.out test102.out + test100.out test101.out test102.out test103.out # Known problems: # Test 30: a problem around mac format - unknown reason diff --git a/src/testdir/Makefile b/src/testdir/Makefile index afff509796..bae4f44ff1 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -30,7 +30,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test84.out test85.out test86.out test87.out test88.out \ test89.out test90.out test91.out test92.out test93.out \ test94.out test95.out test96.out test97.out test98.out \ - test99.out test100.out test101.out test102.out + test99.out test100.out test101.out test102.out test103.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test103.in b/src/testdir/test103.in new file mode 100644 index 0000000000..7c7591e3b9 --- /dev/null +++ b/src/testdir/test103.in @@ -0,0 +1,37 @@ +Test for visual mode not being reset causing E315 error. +STARTTEST +:so small.vim +:enew +:let g:msg="Everything's fine." +:function! TriggerTheProblem() +: " At this point there is no visual selection because :call reset it. +: " Let's restore the selection: +: normal gv +: '<,'>del _ +: try +: exe "normal \" +: catch /^Vim\%((\a\+)\)\=:E315/ +: echom 'Snap! E315 error!' +: let g:msg='Snap! E315 error!' +: endtry +:endfunction +:enew +:setl buftype=nofile +:call append(line('$'), 'Delete this line.') +:" +:" +:" NOTE: this has to be done by a call to a function because executing :del the +:" ex-way will require the colon operator which resets the visual mode thus +:" preventing the problem: +:" +GV:call TriggerTheProblem() +:%del _ +:call append(line('$'), g:msg) +:w! test.out +:brewind +ENDTEST + +STARTTEST +:qa! +ENDTEST + diff --git a/src/testdir/test103.ok b/src/testdir/test103.ok new file mode 100644 index 0000000000..9ea6dd6eea --- /dev/null +++ b/src/testdir/test103.ok @@ -0,0 +1,2 @@ + +Everything's fine. diff --git a/src/version.c b/src/version.c index 739b63e638..505e227f9c 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 98, /**/ 97, /**/ From 0cb06ee87b72ca575415d1475e555e02c56f7b1f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 14:21:40 +0100 Subject: [PATCH 095/105] Added tag v7-4-098 for changeset 79a8bac614c0 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index f2eb8f3175..3106a1088b 100644 --- a/.hgtags +++ b/.hgtags @@ -2820,3 +2820,4 @@ a56f60cf683455bea96daf077458158041e4d6ba v7-4-084 acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 645358801356c7b1c53a1d3b1543781a669a7733 v7-4-096 93c8296281dd64e513d52db9f745965926df5cab v7-4-097 +79a8bac614c0c565617b404764f28675687ad442 v7-4-098 From 61a9b631204b95906676d8a5d126964ddde493a5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 14:40:04 +0100 Subject: [PATCH 096/105] updated for version 7.4.099 Problem: Append in blockwise Visual mode with "$" is wrong. Solution: After "$" don't use the code that checks if the cursor was moved. (Hirohito Higashi, Ken Takata) --- src/ops.c | 2 +- src/testdir/test39.in | 21 +++++++++++++++++++++ src/testdir/test39.ok | Bin 377 -> 420 bytes src/version.c | 2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/ops.c b/src/ops.c index e1048c2554..d2060a47e8 100644 --- a/src/ops.c +++ b/src/ops.c @@ -2643,7 +2643,7 @@ op_insert(oap, count1) /* The user may have moved the cursor before inserting something, try * to adjust the block for that. */ - if (oap->start.lnum == curbuf->b_op_start.lnum) + if (oap->start.lnum == curbuf->b_op_start.lnum && !bd.is_MAX) { if (oap->op_type == OP_INSERT && oap->start.col != curbuf->b_op_start.col) diff --git a/src/testdir/test39.in b/src/testdir/test39.in index 77e2bd7689..4f42a13a5e 100644 --- a/src/testdir/test39.in +++ b/src/testdir/test39.in @@ -23,6 +23,18 @@ G$khhhhhkkcmno /^aaaa/ :exe ":norm! l\jjjlllI\\ \" :/^aa/,/^$/w >> test.out +:" Test for Visual block was created with the last $ +/^A23$/ +:exe ":norm! l\j$Aab\" +:.,/^$/w >> test.out +:" Test for Visual block was created with the middle $ (1) +/^B23$/ +:exe ":norm! l\j$hAab\" +:.,/^$/w >> test.out +:" Test for Visual block was created with the middle $ (2) +/^C23$/ +:exe ":norm! l\j$hhAab\" +:.,/^$/w >> test.out :" gUe must uppercase a whole word, also when changes to SS Gothe youtueuu endYpk0wgUe :" gUfx must uppercase until x, inclusive. @@ -49,6 +61,15 @@ bbbbbb cccccc dddddd +A23 +4567 + +B23 +4567 + +C23 +4567 + abcdefghijklm abcdefghijklm abcdefghijklm diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok index 4964d6a34b93691f1a8530296cb2a2994973317a..3469f52b65c944c6d79c39b21ee2eb6b12739030 100644 GIT binary patch delta 51 qcmey#w1j!WL`_E{ Date: Thu, 21 Nov 2013 14:40:04 +0100 Subject: [PATCH 097/105] Added tag v7-4-099 for changeset 8451f643a13e --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3106a1088b..c6c98769f6 100644 --- a/.hgtags +++ b/.hgtags @@ -2821,3 +2821,4 @@ acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 645358801356c7b1c53a1d3b1543781a669a7733 v7-4-096 93c8296281dd64e513d52db9f745965926df5cab v7-4-097 79a8bac614c0c565617b404764f28675687ad442 v7-4-098 +8451f643a13eaf22e35a45e6bdd47c8d5b24c222 v7-4-099 From 0929f5e41375762794362d447ad6a3f3a0a979c3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 16:03:40 +0100 Subject: [PATCH 098/105] updated for version 7.4.100 Problem: NFA regexp doesn't handle backreference correctly. (Ryuichi Hayashida, Urtica Dioica) Solution: Always add NFA_SKIP, also when it already exists at the start position. --- src/regexp_nfa.c | 2 +- src/testdir/test64.in | 1 + src/testdir/test64.ok | 3 +++ src/version.c | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 0c6ff0b633..cf7694bb0b 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -4278,7 +4278,7 @@ addstate(l, state, subs_arg, pim, off) * endless loop for "\(\)*" */ default: - if (state->lastlist[nfa_ll_index] == l->id) + if (state->lastlist[nfa_ll_index] == l->id && state->c != NFA_SKIP) { /* This state is already in the list, don't add it again, * unless it is an MOPEN that is used for a backreference or diff --git a/src/testdir/test64.in b/src/testdir/test64.in index 2df9a6b60e..77949c5141 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -406,6 +406,7 @@ STARTTEST :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@ Date: Thu, 21 Nov 2013 16:03:40 +0100 Subject: [PATCH 099/105] Added tag v7-4-100 for changeset 5ad60cd88339 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c6c98769f6..97d216b338 100644 --- a/.hgtags +++ b/.hgtags @@ -2822,3 +2822,4 @@ acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 93c8296281dd64e513d52db9f745965926df5cab v7-4-097 79a8bac614c0c565617b404764f28675687ad442 v7-4-098 8451f643a13eaf22e35a45e6bdd47c8d5b24c222 v7-4-099 +5ad60cd88339c6217fbea8cf4f92dae04ac1c71d v7-4-100 From fe116bb335354153510b015c9694678ddd004de2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 17:13:00 +0100 Subject: [PATCH 100/105] updated for version 7.4.101 Problem: Using \1 in pattern goes one line too far. (Bohr Shaw, John Little) Solution: Only advance the match end for the matched characters in the last line. --- src/regexp.c | 5 ++++- src/testdir/test64.in | 2 ++ src/testdir/test64.ok | 3 +++ src/version.c | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/regexp.c b/src/regexp.c index 075374d16b..f1e8909b2a 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -6455,7 +6455,8 @@ re_num_cmp(val, scan) /* * Check whether a backreference matches. * Returns RA_FAIL, RA_NOMATCH or RA_MATCH. - * If "bytelen" is not NULL, it is set to the bytelength of the whole match. + * If "bytelen" is not NULL, it is set to the byte length of the match in the + * last line. */ static int match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen) @@ -6511,6 +6512,8 @@ match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen) /* Advance to next line. */ reg_nextline(); + if (bytelen != NULL) + *bytelen = 0; ++clnum; ccol = 0; if (got_int) diff --git a/src/testdir/test64.in b/src/testdir/test64.in index 77949c5141..29bf0b902b 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -507,6 +507,8 @@ STARTTEST :" Check a pattern with a line break and ^ and $ :call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']]) :" +:call add(tl, [2, '\(^.\+\n\)\1', [' dog', ' dog', 'asdf'], ['XXasdf']]) +:" :"""" Run the multi-line tests :" :$put ='multi-line tests' diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok index 4bbc5335dc..a1498ea5d6 100644 --- a/src/testdir/test64.ok +++ b/src/testdir/test64.ok @@ -1031,6 +1031,9 @@ OK 2 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25 OK 0 - a\n^b$\n^c OK 1 - a\n^b$\n^c OK 2 - a\n^b$\n^c +OK 0 - \(^.\+\n\)\1 +OK 1 - \(^.\+\n\)\1 +OK 2 - \(^.\+\n\)\1 Ta 5 Ac 7 diff --git a/src/version.c b/src/version.c index ab3711d102..47deb0c43e 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 101, /**/ 100, /**/ From 6a530757600ee807c1ec75e5451115ac263b8cf2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 17:13:00 +0100 Subject: [PATCH 101/105] Added tag v7-4-101 for changeset ec5d11403c19 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 97d216b338..556aa26b14 100644 --- a/.hgtags +++ b/.hgtags @@ -2823,3 +2823,4 @@ acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 79a8bac614c0c565617b404764f28675687ad442 v7-4-098 8451f643a13eaf22e35a45e6bdd47c8d5b24c222 v7-4-099 5ad60cd88339c6217fbea8cf4f92dae04ac1c71d v7-4-100 +ec5d11403c1952b2ed192f28afb6261d0867bb20 v7-4-101 From 8758fb04190dbef28748232a9890556595956532 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 17:42:31 +0100 Subject: [PATCH 102/105] updated for version 7.4.102 Problem: Crash when interrupting "z=". Solution: Add safety check for word length. (Christian Brabandt, Dominique Pelle) --- src/spell.c | 6 +++--- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/spell.c b/src/spell.c index 6e0d986d7c..18a39570d8 100644 --- a/src/spell.c +++ b/src/spell.c @@ -13398,9 +13398,8 @@ add_sound_suggest(su, goodword, score, lp) /* Lookup the word "orgnr" one of the two tries. */ n = 0; - wlen = 0; wordcount = 0; - for (;;) + for (wlen = 0; wlen < MAXWLEN - 3; ++wlen) { i = 1; if (wordcount == orgnr && byts[n + 1] == NUL) @@ -13414,6 +13413,7 @@ add_sound_suggest(su, goodword, score, lp) if (i > byts[n]) /* safety check */ { STRCPY(theword + wlen, "BAD"); + wlen += 3; goto badword; } @@ -13426,7 +13426,7 @@ add_sound_suggest(su, goodword, score, lp) wordcount += wc; } - theword[wlen++] = byts[n + i]; + theword[wlen] = byts[n + i]; n = idxs[n + i]; } badword: diff --git a/src/version.c b/src/version.c index 47deb0c43e..4a0538707e 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 102, /**/ 101, /**/ From 167dc3c156749dc5414b228bd3b0d8a3b8a18e43 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 17:42:31 +0100 Subject: [PATCH 103/105] Added tag v7-4-102 for changeset 9417f4de27a2 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 556aa26b14..249475319b 100644 --- a/.hgtags +++ b/.hgtags @@ -2824,3 +2824,4 @@ acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 8451f643a13eaf22e35a45e6bdd47c8d5b24c222 v7-4-099 5ad60cd88339c6217fbea8cf4f92dae04ac1c71d v7-4-100 ec5d11403c1952b2ed192f28afb6261d0867bb20 v7-4-101 +9417f4de27a2a6acfa6b1660ac6ef2b5692e4554 v7-4-102 From 8c88733e784b1d4a9e21ef23a0513e71ac2d8d41 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 18:13:37 +0100 Subject: [PATCH 104/105] updated for version 7.4.103 Problem: Dos installer uses an old way to escape spaces in the diff command. Solution: Adjust the quoting to the new default shellxquote. (Ben Fritz) --- src/dosinst.c | 18 ++++++++++++------ src/version.c | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/dosinst.c b/src/dosinst.c index 3fbfb5c5c2..5b54380fe7 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -1192,23 +1192,29 @@ install_vimrc(int idx) fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n"); /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put - * quotes around the whole command and around the diff command. + * quotes around the diff command and rely on the default value of + * shellxquote to solve the quoting problem for the whole command. + * * Otherwise put a double quote just before the space and at the * end of the command. Putting quotes around the whole thing * doesn't work on Win 95/98/ME. This is mostly guessed! */ - fprintf(fd, " let eq = ''\n"); fprintf(fd, " if $VIMRUNTIME =~ ' '\n"); fprintf(fd, " if &sh =~ '\\ ' . arg3 . eq\n"); - + fprintf(fd, " silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n"); + fprintf(fd, " if exists('l:shxq_sav')\n"); + fprintf(fd, " let &shellxquote=l:shxq_sav\n"); + fprintf(fd, " endif\n"); fprintf(fd, "endfunction\n"); fprintf(fd, "\n"); } diff --git a/src/version.c b/src/version.c index 4a0538707e..d8f95dd472 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 103, /**/ 102, /**/ From fed59ac917f12278bd036764e46894ab66a39fd4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 18:13:38 +0100 Subject: [PATCH 105/105] Added tag v7-4-103 for changeset 4db151014f93 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 249475319b..a2667cb2b6 100644 --- a/.hgtags +++ b/.hgtags @@ -2825,3 +2825,4 @@ acbe5414cb7f302f548bc1cbdc1ddb029dbf9094 v7-4-095 5ad60cd88339c6217fbea8cf4f92dae04ac1c71d v7-4-100 ec5d11403c1952b2ed192f28afb6261d0867bb20 v7-4-101 9417f4de27a2a6acfa6b1660ac6ef2b5692e4554 v7-4-102 +4db151014f93b7512919e452e6b3f4184758db7b v7-4-103