Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2016-09-02 21:27:01 -07:00
21 changed files with 192 additions and 133 deletions
+2 -1
View File
@@ -26,9 +26,10 @@ build_script:
test_script:
- cd src/testdir
# Testing with MSVC gvim
- path C:\Python35-x64;%PATH%
- nmake -f Make_dos.mak VIMPROG=..\gvim
- nmake -f Make_dos.mak clean
# Testing with MingW console version
- nmake -f Make_dos.mak VIMPROG=..\vim
# vim: sw=2 sts=2 et ts=2 sr
# vim: sw=2 sts=2 et ts=8 sr
+6 -4
View File
@@ -2044,7 +2044,6 @@ test1 \
test_autoformat_join \
test_breakindent \
test_changelist \
test_charsearch \
test_close_count \
test_command_count \
test_comparators \
@@ -2063,13 +2062,13 @@ test1 \
test11 test12 test13 test14 test15 test17 test18 test19 \
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
test40 test41 test42 test43 test44 test45 test46 test48 test49 \
test40 test41 test42 test43 test44 test45 test48 test49 \
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
test60 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 \
test80 test82 test83 test84 test85 test86 test87 test88 test89 \
test90 test91 test92 test93 test94 test95 test97 test98 test99 \
test100 test101 test102 test103 test104 test107 test108:
test100 test101 test103 test104 test107 test108:
cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
# Run individual NEW style test, assuming that Vim was already compiled.
@@ -2082,6 +2081,7 @@ test_arglist \
test_bufwintabinfo \
test_cdo \
test_channel \
test_charsearch \
test_cmdline \
test_cscope \
test_cursor_func \
@@ -2099,6 +2099,7 @@ test_arglist \
test_file_perm \
test_filter_cmd \
test_filter_map \
test_fnameescape \
test_fnamemodify \
test_glob2regpat \
test_gn \
@@ -2147,6 +2148,7 @@ test_arglist \
test_startup_utf8 \
test_stat \
test_statusline \
test_substitute \
test_syn_attr \
test_syntax \
test_tabline \
+2 -2
View File
@@ -16,7 +16,7 @@ mingw32-make.exe -f Make_ming.mak clean
:: with specified features without python.
echo "Building MinGW 32bit GUI version"
if "%FEATURE%" == "HUGE" (
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34 FEATURES=%FEATURE% || exit 1
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1
) ELSE (
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
)
@@ -31,7 +31,7 @@ nmake -f Make_mvc2.mak clean
:: GUI needs to be last, so that testing works
echo "Building MSVC 64bit GUI Version"
if "%FEATURE%" == "HUGE" (
nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34-x64 FEATURES=%FEATURE% || exit 1
nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1
) ELSE (
nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
)
+1 -1
View File
@@ -1222,8 +1222,8 @@ check_due_timer(void)
}
else
{
free_timer(timer);
remove_timer(timer);
free_timer(timer);
}
/* the callback may do anything, start all over */
break;
+1 -1
View File
@@ -1747,7 +1747,7 @@ static struct vimoption options[] =
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
{"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
#ifdef FEAT_WINDOWS
(char_u *)&p_ls, PV_NONE,
+3 -4
View File
@@ -42,7 +42,6 @@ SCRIPTS_ALL = \
test43.out \
test44.out \
test45.out \
test46.out \
test48.out \
test51.out \
test53.out \
@@ -64,7 +63,6 @@ SCRIPTS_ALL = \
test77.out \
test79.out \
test80.out \
test81.out \
test82.out \
test84.out \
test88.out \
@@ -77,7 +75,6 @@ SCRIPTS_ALL = \
test98.out \
test99.out \
test101.out \
test102.out \
test103.out \
test104.out \
test107.out \
@@ -86,7 +83,6 @@ SCRIPTS_ALL = \
test_autoformat_join.out \
test_breakindent.out \
test_changelist.out \
test_charsearch.out \
test_close_count.out \
test_command_count.out \
test_comparators.out \
@@ -157,11 +153,13 @@ NEW_TESTS = test_arglist.res \
test_bufwintabinfo.res \
test_cdo.res \
test_channel.res \
test_charsearch.res \
test_cmdline.res \
test_cscope.res \
test_diffmode.res \
test_digraph.res \
test_farsi.res \
test_fnameescape.res \
test_gn.res \
test_gui.res \
test_hardcopy.res \
@@ -185,6 +183,7 @@ NEW_TESTS = test_arglist.res \
test_startup.res \
test_startup_utf8.res \
test_stat.res \
test_substitute.res \
test_syntax.res \
test_textobjects.res \
test_undo.res \
-13
View File
@@ -1,13 +0,0 @@
Test if fnameescape is correct for special chars like !
STARTTEST
:so small.vim
:%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
-3
View File
@@ -1,3 +0,0 @@
Space
ExclamationMark
-27
View File
@@ -1,27 +0,0 @@
Tests for multi-line regexps with ":s". vim: set ft=vim :
STARTTEST
:" test if replacing a line break works with a back reference
:/^1/,/^2/s/\n\(.\)/ \1/
:" test if inserting a line break works with a back reference
:/^3/,/^4/s/\(.\)$/\r\1/
:" test if replacing a line break with another line break works
:/^5/,/^6/s/\(\_d\{3}\)/x\1x/
:/^1/,$w! test.out
:qa!
ENDTEST
1 aa
bb
cc
2 dd
ee
3 ef
gh
4 ij
5 a8
8b c9
9d
6 e7
77f
xxxxx
-13
View File
@@ -1,13 +0,0 @@
1 aa bb cc 2 dd ee
3 e
f
g
h
4 i
j
5 ax8
8xb cx9
9xd
6 ex7
7x7f
xxxxx
-22
View File
@@ -1,22 +0,0 @@
Test for t movement command and 'cpo-;' setting
STARTTEST
:set nocompatible viminfo+=nviminfo
:set cpo-=;
/firstline/
j0tt;D
0fz;D
$Fy;D
$Ty;D:set cpo+=;
j0tt;;D
$Ty;;D:?firstline?+1,$w! test.out
:qa!
ENDTEST
firstline
aaa two three four
zzz
yyy
bbb yee yoo four
ccc two three four
ddd yee yoo four
-6
View File
@@ -1,6 +0,0 @@
aaa two
z
y
bbb y
ccc
ddd yee y
-26
View File
@@ -1,26 +0,0 @@
Test for character searches
STARTTEST
:so small.vim
:" check that "fe" and ";" work
/^X
ylfep;;p,,p:
:" check that save/restore works
/^Y
ylfep:let csave = getcharsearch()
fip:call setcharsearch(csave)
;p;p:
:" check that setcharsearch() changes the settings.
/^Z
ylfep:call setcharsearch({'char': 'k'})
;p:call setcharsearch({'forward': 0})
$;p:call setcharsearch({'until': 1})
:set cpo-=;
;;p:
:/^X/,$w! test.out
:qa!
ENDTEST
Xabcdefghijkemnopqretuvwxyz
Yabcdefghijkemnopqretuvwxyz
Zabcdefghijkemnokqretkvwxyz
-3
View File
@@ -1,3 +0,0 @@
XabcdeXfghijkeXmnopqreXtuvwxyz
YabcdeYfghiYjkeYmnopqreYtuvwxyz
ZabcdeZfghijkZZemnokqretkZvwxyz
+62
View File
@@ -0,0 +1,62 @@
function! Test_charsearch()
enew!
call append(0, ['Xabcdefghijkemnopqretuvwxyz',
\ 'Yabcdefghijkemnopqretuvwxyz',
\ 'Zabcdefghijkemnokqretkvwxyz'])
" check that "fe" and ";" work
1
normal! ylfep;;p,,p
call assert_equal('XabcdeXfghijkeXmnopqreXtuvwxyz', getline(1))
" check that save/restore works
2
normal! ylfep
let csave = getcharsearch()
normal! fip
call setcharsearch(csave)
normal! ;p;p
call assert_equal('YabcdeYfghiYjkeYmnopqreYtuvwxyz', getline(2))
" check that setcharsearch() changes the settings.
3
normal! ylfep
call setcharsearch({'char': 'k'})
normal! ;p
call setcharsearch({'forward': 0})
normal! $;p
call setcharsearch({'until': 1})
set cpo-=;
normal! ;;p
call assert_equal('ZabcdeZfghijkZZemnokqretkZvwxyz', getline(3))
enew!
endfunction
" Test for t,f,F,T movement commands and 'cpo-;' setting
function! Test_search_cmds()
enew!
call append(0, ["aaa two three four", " zzz", "yyy ",
\ "bbb yee yoo four", "ccc two three four",
\ "ddd yee yoo four"])
set cpo-=;
1
normal! 0tt;D
2
normal! 0fz;D
3
normal! $Fy;D
4
normal! $Ty;D
set cpo+=;
5
normal! 0tt;;D
6
normal! $Ty;;D
call assert_equal('aaa two', getline(1))
call assert_equal(' z', getline(2))
call assert_equal('y', getline(3))
call assert_equal('bbb y', getline(4))
call assert_equal('ccc', getline(5))
call assert_equal('ddd yee y', getline(6))
enew!
endfunction
+21
View File
@@ -0,0 +1,21 @@
" Test if fnameescape is correct for special chars like !
function! Test_fnameescape()
let fname = 'Xspa ce'
let status = v:false
try
exe "w! " . fnameescape(fname)
let status = v:true
endtry
call assert_true(status, "Space")
call delete(fname)
let fname = 'Xemark!'
let status = v:false
try
exe "w! " . fnameescape(fname)
let status = v:true
endtry
call assert_true(status, "ExclamationMark")
call delete(fname)
endfunction
+8
View File
@@ -72,6 +72,14 @@ func Test_map_langmap()
set nolangremap
call assert_equal(1, &langnoremap)
" check default values
set langnoremap&
call assert_equal(0, &langnoremap)
call assert_equal(1, &langremap)
set langremap&
call assert_equal(0, &langnoremap)
call assert_equal(1, &langremap)
" langmap should not apply in insert mode, 'langremap' doesn't matter
set langmap=+{ nolangremap
call feedkeys("Go+\<Esc>", "xt")
+41
View File
@@ -0,0 +1,41 @@
" Tests for multi-line regexps with ":s".
function! Test_multiline_subst()
enew!
call append(0, ["1 aa",
\ "bb",
\ "cc",
\ "2 dd",
\ "ee",
\ "3 ef",
\ "gh",
\ "4 ij",
\ "5 a8",
\ "8b c9",
\ "9d",
\ "6 e7",
\ "77f",
\ "xxxxx"])
1
" test if replacing a line break works with a back reference
/^1/,/^2/s/\n\(.\)/ \1/
" test if inserting a line break works with a back reference
/^3/,/^4/s/\(.\)$/\r\1/
" test if replacing a line break with another line break works
/^5/,/^6/s/\(\_d\{3}\)/x\1x/
call assert_equal('1 aa bb cc 2 dd ee', getline(1))
call assert_equal('3 e', getline(2))
call assert_equal('f', getline(3))
call assert_equal('g', getline(4))
call assert_equal('h', getline(5))
call assert_equal('4 i', getline(6))
call assert_equal('j', getline(7))
call assert_equal('5 ax8', getline(8))
call assert_equal('8xb cx9', getline(9))
call assert_equal('9xd', getline(10))
call assert_equal('6 ex7', getline(11))
call assert_equal('7x7f', getline(12))
call assert_equal('xxxxx', getline(13))
enew!
endfunction
+14
View File
@@ -218,4 +218,18 @@ function Test_tabpage_with_tab_modifier()
bw!
endfunction
func Test_tabnext_on_buf_unload()
" This once caused a crash
new
tabedit
tabfirst
au BufUnload <buffer> tabnext
q
while tabpagenr('$') > 1
quit
endwhile
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+12
View File
@@ -778,6 +778,18 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2311,
/**/
2310,
/**/
2309,
/**/
2308,
/**/
2307,
/**/
2306,
/**/
2305,
/**/
+19 -7
View File
@@ -2384,7 +2384,7 @@ win_close(win_T *win, int free_buf)
#endif
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE);
#ifdef FEAT_AUTOCMD
if (win_valid(win))
if (win_valid_any_tab(win))
win->w_closing = FALSE;
#endif
/* Make sure curbuf is valid. It can become invalid if 'bufhidden' is
@@ -2404,9 +2404,18 @@ win_close(win_T *win, int free_buf)
getout(0);
}
/* Autocommands may have closed the window already, or closed the only
* other window or moved to another tab page. */
else if (!win_valid(win) || last_window() || curtab != prev_curtab
/* Autocommands may have moved to another tab page. */
if (curtab != prev_curtab && win_valid_any_tab(win)
&& win->w_buffer == NULL)
{
/* Need to close the window anyway, since the buffer is NULL. */
win_close_othertab(win, FALSE, prev_curtab);
return FAIL;
}
/* Autocommands may have closed the window already or closed the only
* other window. */
if (!win_valid(win) || last_window()
|| close_last_window_tabpage(win, free_buf, prev_curtab))
return FAIL;
@@ -2497,12 +2506,15 @@ win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
int free_tp = FALSE;
#ifdef FEAT_AUTOCMD
if (win->w_closing || win->w_buffer->b_closing)
/* Get here with win->w_buffer == NULL when win_close() detects the tab
* page changed. */
if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing))
return; /* window is already being closed */
#endif
/* Close the link to the buffer. */
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
if (win->w_buffer != NULL)
/* Close the link to the buffer. */
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
/* Careful: Autocommands may have closed the tab page or made it the
* current tab page. */