mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
+1
-1
@@ -344,7 +344,7 @@ ml_open(buf_T *buf)
|
||||
b0p->b0_magic_int = (int)B0_MAGIC_INT;
|
||||
b0p->b0_magic_short = (short)B0_MAGIC_SHORT;
|
||||
b0p->b0_magic_char = B0_MAGIC_CHAR;
|
||||
STRNCPY(b0p->b0_version, "VIM ", 4);
|
||||
mch_memmove(b0p->b0_version, "VIM ", 4);
|
||||
STRNCPY(b0p->b0_version + 4, Version, 6);
|
||||
long_to_char((long)mfp->mf_page_size, b0p->b0_page_size);
|
||||
|
||||
|
||||
@@ -309,3 +309,65 @@ func Test_gd_local_block()
|
||||
\ ]
|
||||
call XTest_goto_decl('1gd', lines, 11, 11)
|
||||
endfunc
|
||||
|
||||
func Test_motion_if_elif_else_endif()
|
||||
new
|
||||
a
|
||||
/* Test pressing % on #if, #else #elsif and #endif,
|
||||
* with nested #if
|
||||
*/
|
||||
#if FOO
|
||||
/* ... */
|
||||
# if BAR
|
||||
/* ... */
|
||||
# endif
|
||||
#elif BAR
|
||||
/* ... */
|
||||
#else
|
||||
/* ... */
|
||||
#endif
|
||||
.
|
||||
/#if FOO
|
||||
norm %
|
||||
call assert_equal([9, 1], getpos('.')[1:2])
|
||||
norm %
|
||||
call assert_equal([11, 1], getpos('.')[1:2])
|
||||
norm %
|
||||
call assert_equal([13, 1], getpos('.')[1:2])
|
||||
norm %
|
||||
call assert_equal([4, 1], getpos('.')[1:2])
|
||||
/# if BAR
|
||||
norm $%
|
||||
call assert_equal([8, 1], getpos('.')[1:2])
|
||||
norm $%
|
||||
call assert_equal([6, 1], getpos('.')[1:2])
|
||||
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_motion_c_comment()
|
||||
new
|
||||
a
|
||||
/*
|
||||
* Test pressing % on beginning/end
|
||||
* of C comments.
|
||||
*/
|
||||
/* Another comment */
|
||||
.
|
||||
norm gg0%
|
||||
call assert_equal([4, 3], getpos('.')[1:2])
|
||||
norm %
|
||||
call assert_equal([1, 1], getpos('.')[1:2])
|
||||
norm gg0l%
|
||||
call assert_equal([4, 3], getpos('.')[1:2])
|
||||
norm h%
|
||||
call assert_equal([1, 1], getpos('.')[1:2])
|
||||
|
||||
norm G^
|
||||
norm %
|
||||
call assert_equal([5, 21], getpos('.')[1:2])
|
||||
norm %
|
||||
call assert_equal([5, 1], getpos('.')[1:2])
|
||||
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
@@ -270,7 +270,7 @@ func Test_terminal_scroll()
|
||||
endfunc
|
||||
|
||||
func Test_terminal_scrollback()
|
||||
let buf = Run_shell_in_terminal({})
|
||||
let buf = Run_shell_in_terminal({'term_rows': 15})
|
||||
set termwinscroll=100
|
||||
call writefile(range(150), 'Xtext')
|
||||
if has('win32')
|
||||
|
||||
@@ -85,7 +85,7 @@ endfunc
|
||||
func FillBuffer()
|
||||
for i in range(1,13)
|
||||
put=i
|
||||
" Set 'undolevels' to split undo.
|
||||
" Set 'undolevels' to split undo.
|
||||
exe "setg ul=" . &g:ul
|
||||
endfor
|
||||
endfunc
|
||||
@@ -193,19 +193,19 @@ func Test_undolist()
|
||||
new
|
||||
set ul=100
|
||||
|
||||
let a=execute('undolist')
|
||||
let a = execute('undolist')
|
||||
call assert_equal("\nNothing to undo", a)
|
||||
|
||||
" 1 leaf (2 changes).
|
||||
call feedkeys('achange1', 'xt')
|
||||
call feedkeys('achange2', 'xt')
|
||||
let a=execute('undolist')
|
||||
let a = execute('undolist')
|
||||
call assert_match("^\nnumber changes when *saved\n *2 *2 .*$", a)
|
||||
|
||||
" 2 leaves.
|
||||
call feedkeys('u', 'xt')
|
||||
call feedkeys('achange3\<Esc>', 'xt')
|
||||
let a=execute('undolist')
|
||||
let a = execute('undolist')
|
||||
call assert_match("^\nnumber changes when *saved\n *2 *2 *.*\n *3 *2 .*$", a)
|
||||
close!
|
||||
endfunc
|
||||
@@ -339,7 +339,7 @@ endfunc
|
||||
" Also test this in an empty buffer.
|
||||
func Test_cmd_in_reg_undo()
|
||||
enew!
|
||||
let @a="Ox\<Esc>jAy\<Esc>kdd"
|
||||
let @a = "Ox\<Esc>jAy\<Esc>kdd"
|
||||
edit +/^$ test_undo.vim
|
||||
normal @au
|
||||
call assert_equal(0, &modified)
|
||||
@@ -348,7 +348,7 @@ func Test_cmd_in_reg_undo()
|
||||
normal @au
|
||||
call assert_equal(0, &modified)
|
||||
only!
|
||||
let @a=''
|
||||
let @a = ''
|
||||
endfunc
|
||||
|
||||
" This used to cause an illegal memory access
|
||||
@@ -410,3 +410,35 @@ func Test_redo_empty_line()
|
||||
exe "norm."
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
funct Test_undofile()
|
||||
" Test undofile() without setting 'undodir'.
|
||||
if has('persistent_undo')
|
||||
call assert_equal(fnamemodify('.Xundofoo.un~', ':p'), undofile('Xundofoo'))
|
||||
else
|
||||
call assert_equal('', undofile('Xundofoo'))
|
||||
endif
|
||||
call assert_equal('', undofile(''))
|
||||
|
||||
" Test undofile() with 'undodir' set to to an existing directory.
|
||||
call mkdir('Xundodir')
|
||||
set undodir=Xundodir
|
||||
let cwd = getcwd()
|
||||
if has('win32')
|
||||
" Replace windows drive such as C:... into C%...
|
||||
let cwd = substitute(cwd, '^\([A-Z]\):', '\1%', 'g')
|
||||
endif
|
||||
let cwd = substitute(cwd . '/Xundofoo', '/', '%', 'g')
|
||||
if has('persistent_undo')
|
||||
call assert_equal('Xundodir/' . cwd, undofile('Xundofoo'))
|
||||
else
|
||||
call assert_equal('', undofile('Xundofoo'))
|
||||
endif
|
||||
call assert_equal('', undofile(''))
|
||||
call delete('Xundodir', 'd')
|
||||
|
||||
" Test undofile() with 'undodir' set to a non-existing directory.
|
||||
call assert_equal('', undofile('Xundofoo'))
|
||||
|
||||
set undodir&
|
||||
endfunc
|
||||
|
||||
@@ -776,6 +776,14 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
26,
|
||||
/**/
|
||||
25,
|
||||
/**/
|
||||
24,
|
||||
/**/
|
||||
23,
|
||||
/**/
|
||||
22,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user