From f845b87f2b3a45cbee160e28d7a3f50e54054809 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 14:04:54 +0100 Subject: [PATCH 01/10] patch 8.0.0143: line number of current buffer in getbufinfo() is wrong Problem: Line number of current buffer in getbufinfo() is wrong. Solution: For the current buffer use the current line number. (Ken Takata) --- src/evalfunc.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index 08be12bb18..f1fa7401e1 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3973,7 +3973,8 @@ get_buffer_info(buf_T *buf) dict_add_nr_str(dict, "bufnr", buf->b_fnum, NULL); dict_add_nr_str(dict, "name", 0L, buf->b_ffname != NULL ? buf->b_ffname : (char_u *)""); - dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL); + dict_add_nr_str(dict, "lnum", buf == curbuf ? curwin->w_cursor.lnum + : buflist_findlnum(buf), NULL); dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL); dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL); dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL); diff --git a/src/version.c b/src/version.c index 4ee83cd4ac..d4224cbdbd 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 143, /**/ 142, /**/ From 9269315f635e44a340389be7e986782b98499311 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 14:55:36 +0100 Subject: [PATCH 02/10] patch 8.0.0144: when using MSVC the GvimExt directory is cleaned twice Problem: When using MSVC the GvimExt directory is cleaned twice. Solution: Remove the lines. (Ken Takata) --- src/Make_mvc.mak | 3 --- src/version.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 5160aebd7b..f1ecbe0b6b 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -1123,9 +1123,6 @@ clean: cd GvimExt $(MAKE) /NOLOGO -f Makefile clean cd .. - cd GvimExt - $(MAKE) /NOLOGO -f Makefile clean - cd .. - if exist testdir\*.out del testdir\*.out test: diff --git a/src/version.c b/src/version.c index d4224cbdbd..78717e14a6 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 144, /**/ 143, /**/ From 294740d2ac42e3dfdc7f0f6f02a6e2ff2d17c848 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 15:28:44 +0100 Subject: [PATCH 03/10] Attempt to make coverage working again. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d4472f20be..65790db30a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,6 +66,7 @@ addons: before_install: - pip install --user cpp-coveralls + - pip install --user requests[security] # Lua is not installed on Travis OSX - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lua; export LUA_PREFIX=/usr/local; fi From a4ce25bd987a8fad44ad5e47f7785cf9295322be Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 15:37:45 +0100 Subject: [PATCH 04/10] Another attempt to make coveralls work. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 65790db30a..56034ac8d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,7 +66,7 @@ addons: before_install: - pip install --user cpp-coveralls - - pip install --user requests[security] + - pip install --user pyopenssl ndg-httpsclient pyasn1 # Lua is not installed on Travis OSX - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lua; export LUA_PREFIX=/usr/local; fi From 7034a83743459a46287944a127cc041dcf8b799c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 16:01:59 +0100 Subject: [PATCH 05/10] Tune travis config for coverage with gcc only. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 56034ac8d0..d5a288fac9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,7 +66,8 @@ addons: before_install: - pip install --user cpp-coveralls - - pip install --user pyopenssl ndg-httpsclient pyasn1 + # building cffi only works sith gcc, not with clang + - if [ "$CC" = "gcc" ]; then pip install --user pyopenssl ndg-httpsclient pyasn1; fi # Lua is not installed on Travis OSX - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lua; export LUA_PREFIX=/usr/local; fi From 14a612fa2e5705547d0687ac07abc200c9359125 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 16:35:04 +0100 Subject: [PATCH 06/10] Better solution to make coveralls work again. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5a288fac9..2bda14da48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,8 +66,9 @@ addons: before_install: - pip install --user cpp-coveralls + # needed for https support for coveralls # building cffi only works sith gcc, not with clang - - if [ "$CC" = "gcc" ]; then pip install --user pyopenssl ndg-httpsclient pyasn1; fi + - CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1 # Lua is not installed on Travis OSX - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lua; export LUA_PREFIX=/usr/local; fi From aaeabfbca571e24a29925dacf104e21dc251a771 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 16:47:24 +0100 Subject: [PATCH 07/10] Only install coveralls when used. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2bda14da48..543b033f62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,10 +65,10 @@ addons: - cscope before_install: - - pip install --user cpp-coveralls + - if [ "$COVERAGE" = "yes" ]; then pip install --user cpp-coveralls; fi # needed for https support for coveralls - # building cffi only works sith gcc, not with clang - - CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1 + # building cffi only works with gcc, not with clang + - if [ "$COVERAGE" = "yes" ]; then CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1; fi # Lua is not installed on Travis OSX - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lua; export LUA_PREFIX=/usr/local; fi From 29891c4ed4a7d08af1ba1628933a387adf5c1555 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 18:00:12 +0100 Subject: [PATCH 08/10] patch 8.0.0145: running tests on MS-Windows is noisy Problem: Running tests on MS-Windows is a little bit noisy. Solution: Redirect some output to "nul". (Ken Takata) --- src/testdir/Make_dos.mak | 14 +++++++------- src/version.c | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index b6aaa6e68f..c28b1a4b1b 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -44,12 +44,12 @@ $(DOSTMP_INFILES): $(*B).in # This moves test99.in to test99.in.bak temporarily. $(TEST_OUTFILES): $(DOSTMP)\$(*B).in -@if exist test.out DEL test.out - move $(*B).in $(*B).in.bak - copy $(DOSTMP)\$(*B).in $(*B).in - copy $(*B).ok test.ok + move $(*B).in $(*B).in.bak > nul + copy $(DOSTMP)\$(*B).in $(*B).in > nul + copy $(*B).ok test.ok > nul $(VIMPROG) -u dos.vim $(NO_PLUGIN) -s dotest.in $(*B).in - -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out - -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in + -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out > nul + -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in > nul -@if exist test.ok del test.ok -@if exist Xdir1 rd /s /q Xdir1 -@if exist Xfind rd /s /q Xfind @@ -58,10 +58,10 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in $(VIMPROG) -u dos.vim $(NO_PLUGIN) "+set ff=unix|f test.out|wq" \ $(DOSTMP)\$(*B).out @diff test.out $*.ok & if errorlevel 1 \ - ( move /y test.out $*.failed \ + ( move /y test.out $*.failed > nul \ & del $(DOSTMP)\$(*B).out \ & echo $* FAILED >> test.log ) \ - else ( move /y test.out $*.out ) + else ( move /y test.out $*.out > nul ) # Must run test1 first to create small.vim. # This rule must come after the one that copies the input files to dostmp to diff --git a/src/version.c b/src/version.c index 78717e14a6..c3c33dc72f 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 145, /**/ 144, /**/ From 287266527abc163e191a06dd70518bbbdab4468f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 18:16:19 +0100 Subject: [PATCH 09/10] patch 8.0.0146: termguicolors uses wrong colors on MS-Windows with ConEmu Problem: When using 'termguicolors' on MS-Windows the RGB definition causes the colors to be wrong. Solution: Undefined RGB and use our own. (Gabriel Barta) --- src/term.c | 8 ++++++-- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/term.c b/src/term.c index a9c2c57fd0..65b86b2842 100644 --- a/src/term.c +++ b/src/term.c @@ -6069,8 +6069,12 @@ hex_digit(int c) guicolor_T gui_get_color_cmn(char_u *name) { - /* On MS-Windows an RGB macro is available and it's different from ours, - * but does what is needed. */ + /* On MS-Windows an RGB macro is available and it produces 0x00bbggrr color + * values as used by the MS-Windows GDI api. It should be used only for + * MS-Windows GDI builds. */ +# if defined(RGB) && defined(WIN32) && !defined(FEAT_GUI) +# undef RGB +# endif # ifndef RGB # define RGB(r, g, b) ((r<<16) | (g<<8) | (b)) # endif diff --git a/src/version.c b/src/version.c index c3c33dc72f..775f7df218 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 146, /**/ 145, /**/ From 6e450a57541676036203a72d40b2e604e938371e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 6 Jan 2017 20:03:58 +0100 Subject: [PATCH 10/10] patch 8.0.0147: searchpair() fails when 'magic' is off Problem: searchpair() does not work when 'magic' is off. (Chris Paul) Solution: Add \m in the pattern. (Christian Brabandt, closes #1341) --- src/evalfunc.c | 8 ++++---- src/testdir/test_search.vim | 15 +++++++++++++++ src/version.c | 2 ++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index f1fa7401e1..10f6b182e7 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -9509,15 +9509,15 @@ do_searchpair( /* Make two search patterns: start/end (pat2, for in nested pairs) and * start/middle/end (pat3, for the top pair). */ - pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 15)); - pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 23)); + pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 17)); + pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 25)); if (pat2 == NULL || pat3 == NULL) goto theend; - sprintf((char *)pat2, "\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat); + sprintf((char *)pat2, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat); if (*mpat == NUL) STRCPY(pat3, pat2); else - sprintf((char *)pat3, "\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)", + sprintf((char *)pat3, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat, mpat); if (flags & SP_START) options |= SEARCH_START; diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 3b9aff4e7d..040a8098a8 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -279,3 +279,18 @@ func Test_use_sub_pat() call X() bwipe! endfunc + +func Test_searchpair() + new + call setline(1, ['other code here', '', '[', '" cursor here', ']']) + 4 + let a=searchpair('\[','',']','bW') + call assert_equal(3, a) + set nomagic + 4 + let a=searchpair('\[','',']','bW') + call assert_equal(3, a) + set magic + q! +endfunc + diff --git a/src/version.c b/src/version.c index 775f7df218..bd0220ff61 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 147, /**/ 146, /**/