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:
@@ -2154,6 +2154,7 @@ test_arglist \
|
||||
test_crypt \
|
||||
test_cscope \
|
||||
test_cursor_func \
|
||||
test_curswant \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
@@ -2172,6 +2173,7 @@ test_arglist \
|
||||
test_farsi \
|
||||
test_feedkeys \
|
||||
test_file_perm \
|
||||
test_file_size \
|
||||
test_fileformat \
|
||||
test_filetype \
|
||||
test_filter_cmd \
|
||||
@@ -2206,6 +2208,8 @@ test_arglist \
|
||||
test_lambda \
|
||||
test_langmap \
|
||||
test_largefile \
|
||||
test_let \
|
||||
test_lineending \
|
||||
test_lispwords \
|
||||
test_listlbr \
|
||||
test_listlbr_utf8 \
|
||||
@@ -2250,6 +2254,7 @@ test_arglist \
|
||||
test_reltime \
|
||||
test_retab \
|
||||
test_ruby \
|
||||
test_scrollbind \
|
||||
test_search \
|
||||
test_searchpos \
|
||||
test_set \
|
||||
|
||||
+44
-1
@@ -5804,9 +5804,52 @@ buf_spname(buf_T *buf)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
||||
#if defined(FEAT_JOB_CHANNEL) \
|
||||
|| defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|
||||
|| defined(PROTO)
|
||||
# define SWITCH_TO_WIN
|
||||
|
||||
/*
|
||||
* Find a window that contains "buf" and switch to it.
|
||||
* If there is no such window, use the current window and change "curbuf".
|
||||
* Caller must initialize save_curbuf to NULL.
|
||||
* restore_win_for_buf() MUST be called later!
|
||||
*/
|
||||
void
|
||||
switch_to_win_for_buf(
|
||||
buf_T *buf,
|
||||
win_T **save_curwinp,
|
||||
tabpage_T **save_curtabp,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (find_win_for_buf(buf, &wp, &tp) == FAIL)
|
||||
switch_buffer(save_curbuf, buf);
|
||||
else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
|
||||
{
|
||||
restore_win(*save_curwinp, *save_curtabp, TRUE);
|
||||
switch_buffer(save_curbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
restore_win_for_buf(
|
||||
win_T *save_curwin,
|
||||
tabpage_T *save_curtab,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
if (save_curbuf->br_buf == NULL)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
else
|
||||
restore_buffer(save_curbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
||||
|| defined(SWITCH_TO_WIN) \
|
||||
|| defined(PROTO)
|
||||
/*
|
||||
* Find a window for buffer "buf".
|
||||
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
|
||||
|
||||
+11
-6
@@ -2305,7 +2305,9 @@ invoke_one_time_callback(
|
||||
static void
|
||||
append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
{
|
||||
buf_T *save_curbuf = curbuf;
|
||||
bufref_T save_curbuf = {NULL, 0, 0};
|
||||
win_T *save_curwin = NULL;
|
||||
tabpage_T *save_curtab = NULL;
|
||||
linenr_T lnum = buffer->b_ml.ml_line_count;
|
||||
int save_write_to = buffer->b_write_to_channel;
|
||||
chanpart_T *ch_part = &channel->ch_part[part];
|
||||
@@ -2334,8 +2336,10 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
ch_log(channel, "appending line %d to buffer", (int)lnum + 1 - empty);
|
||||
|
||||
buffer->b_p_ma = TRUE;
|
||||
curbuf = buffer;
|
||||
curwin->w_buffer = curbuf;
|
||||
|
||||
/* Save curbuf/curwin/curtab and make "buffer" the current buffer. */
|
||||
switch_to_win_for_buf(buffer, &save_curwin, &save_curtab, &save_curbuf);
|
||||
|
||||
u_sync(TRUE);
|
||||
/* ignore undo failure, undo is not very useful here */
|
||||
ignored = u_save(lnum - empty, lnum + 1);
|
||||
@@ -2349,8 +2353,10 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
else
|
||||
ml_append(lnum, msg, 0, FALSE);
|
||||
appended_lines_mark(lnum, 1L);
|
||||
curbuf = save_curbuf;
|
||||
curwin->w_buffer = curbuf;
|
||||
|
||||
/* Restore curbuf/curwin/curtab */
|
||||
restore_win_for_buf(save_curwin, save_curtab, &save_curbuf);
|
||||
|
||||
if (ch_part->ch_nomodifiable)
|
||||
buffer->b_p_ma = FALSE;
|
||||
else
|
||||
@@ -2359,7 +2365,6 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
if (buffer->b_nwindows > 0)
|
||||
{
|
||||
win_T *wp;
|
||||
win_T *save_curwin;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
|
||||
@@ -4262,43 +4262,6 @@ py_fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra)
|
||||
invalidate_botline();
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a window that contains "buf" and switch to it.
|
||||
* If there is no such window, use the current window and change "curbuf".
|
||||
* Caller must initialize save_curbuf to NULL.
|
||||
* restore_win_for_buf() MUST be called later!
|
||||
*/
|
||||
static void
|
||||
switch_to_win_for_buf(
|
||||
buf_T *buf,
|
||||
win_T **save_curwinp,
|
||||
tabpage_T **save_curtabp,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (find_win_for_buf(buf, &wp, &tp) == FAIL)
|
||||
switch_buffer(save_curbuf, buf);
|
||||
else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
|
||||
{
|
||||
restore_win(*save_curwinp, *save_curtabp, TRUE);
|
||||
switch_buffer(save_curbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
restore_win_for_buf(
|
||||
win_T *save_curwin,
|
||||
tabpage_T *save_curtab,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
if (save_curbuf->br_buf == NULL)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
else
|
||||
restore_buffer(save_curbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Replace a line in the specified buffer. The line number is
|
||||
* in Vim format (1-based). The replacement line is given as
|
||||
|
||||
@@ -61,6 +61,8 @@ int bt_dontwrite(buf_T *buf);
|
||||
int bt_dontwrite_msg(buf_T *buf);
|
||||
int buf_hide(buf_T *buf);
|
||||
char_u *buf_spname(buf_T *buf);
|
||||
void switch_to_win_for_buf(buf_T *buf, win_T **save_curwinp, tabpage_T **save_curtabp, bufref_T *save_curbuf);
|
||||
void restore_win_for_buf(win_T *save_curwin, tabpage_T *save_curtab, bufref_T *save_curbuf);
|
||||
int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
|
||||
void buf_addsign(buf_T *buf, int id, linenr_T lnum, int typenr);
|
||||
linenr_T buf_change_sign_type(buf_T *buf, int markId, int typenr);
|
||||
|
||||
+4
-1
@@ -696,8 +696,11 @@ move_terminal_to_buffer(term_T *term)
|
||||
VTermPos pos;
|
||||
VTermScreenCell cell;
|
||||
VTermScreenCell *p;
|
||||
VTermScreen *screen = vterm_obtain_screen(term->tl_vterm);
|
||||
VTermScreen *screen;
|
||||
|
||||
if (term->tl_vterm == NULL)
|
||||
return;
|
||||
screen = vterm_obtain_screen(term->tl_vterm);
|
||||
for (pos.row = 0; pos.row < term->tl_rows; ++pos.row)
|
||||
{
|
||||
len = 0;
|
||||
|
||||
@@ -18,12 +18,10 @@ SCRIPTS_ALL = \
|
||||
test5.out \
|
||||
test7.out \
|
||||
test8.out \
|
||||
test9.out \
|
||||
test14.out \
|
||||
test15.out \
|
||||
test19.out \
|
||||
test20.out \
|
||||
test22.out \
|
||||
test28.out \
|
||||
test29.out \
|
||||
test31.out \
|
||||
@@ -52,18 +50,14 @@ SCRIPTS_ALL = \
|
||||
test69.out \
|
||||
test70.out \
|
||||
test73.out \
|
||||
test77.out \
|
||||
test79.out \
|
||||
test80.out \
|
||||
test84.out \
|
||||
test88.out \
|
||||
test91.out \
|
||||
test94.out \
|
||||
test95.out \
|
||||
test98.out \
|
||||
test99.out \
|
||||
test103.out \
|
||||
test104.out \
|
||||
test107.out \
|
||||
test108.out \
|
||||
test_autoformat_join.out \
|
||||
@@ -137,11 +131,13 @@ NEW_TESTS = test_arabic.res \
|
||||
test_command_count.res \
|
||||
test_crypt.res \
|
||||
test_cscope.res \
|
||||
test_curswant.res \
|
||||
test_diffmode.res \
|
||||
test_digraph.res \
|
||||
test_display.res \
|
||||
test_edit.res \
|
||||
test_farsi.res \
|
||||
test_file_size.res \
|
||||
test_fnameescape.res \
|
||||
test_fold.res \
|
||||
test_gf.res \
|
||||
@@ -158,6 +154,8 @@ NEW_TESTS = test_arabic.res \
|
||||
test_job_fails.res \
|
||||
test_json.res \
|
||||
test_langmap.res \
|
||||
test_let.res \
|
||||
test_lineending.res \
|
||||
test_listlbr.res \
|
||||
test_listlbr_utf8.res \
|
||||
test_lua.res \
|
||||
@@ -186,6 +184,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_retab.res \
|
||||
test_registers.res \
|
||||
test_ruby.res \
|
||||
test_scrollbind.res \
|
||||
test_search.res \
|
||||
test_signs.res \
|
||||
test_smartindent.res \
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
# Comment out if you have GNU compatible diff on your system
|
||||
# HAVE_GDIFF = YES
|
||||
|
||||
# Comment out if you have GNU compatible cksum on your system
|
||||
# HAVE_CKSUM = YES
|
||||
|
||||
# Comment out if you have ICONV support
|
||||
# HAVE_ICONV = YES
|
||||
|
||||
@@ -77,9 +74,9 @@ VIMPROG = <->vim.exe
|
||||
.SUFFIXES : .out .in
|
||||
|
||||
SCRIPT = test1.out test3.out test4.out test5.out \
|
||||
test7.out test8.out test9.out \
|
||||
test7.out test8.out \
|
||||
test14.out test15.out \
|
||||
test19.out test20.out test22.out \
|
||||
test19.out test20.out \
|
||||
test28.out test29.out test30.out test31.out test32.out \
|
||||
test33.out test34.out test36.out test37.out \
|
||||
test38.out test39.out test40.out test41.out test42.out \
|
||||
@@ -90,10 +87,10 @@ SCRIPT = test1.out test3.out test4.out test5.out \
|
||||
test66.out test68.out test69.out \
|
||||
test72.out \
|
||||
test77a.out test78.out test79.out test80.out \
|
||||
test84.out test88.out \
|
||||
test88.out \
|
||||
test91.out test94.out \
|
||||
test95.out test98.out test99.out \
|
||||
test103.out test104.out \
|
||||
test95.out test99.out \
|
||||
test103.out \
|
||||
test107.out test108.out\
|
||||
test_autocmd_option.out \
|
||||
test_autoformat_join.out \
|
||||
@@ -164,10 +161,6 @@ SCRIPT_GZIP = test11.out
|
||||
SCRIPT_GDIFF = test47.out
|
||||
.ENDIF
|
||||
|
||||
.IFDEF HAVE_CKSUM
|
||||
SCRIPT_CKSUM = test77.out
|
||||
.ENDIF
|
||||
|
||||
.IFDEF HAVE_ICONV
|
||||
SCRIPT_ICONV = test83.out
|
||||
.ENDIF
|
||||
@@ -201,7 +194,7 @@ SCRIPT_PYTHON = test86.out test87.out
|
||||
-@ if "''F$SEARCH("Xtest.*")'" .NES. "" then delete/noconfirm/nolog Xtest.*.*
|
||||
|
||||
all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_SPELL) $(SCRIPT_ODS5) $(SCRIPT_GZIP) \
|
||||
$(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_CKSUM) $(SCRIPT_ICONV) $(SCRIPT_LUA) $(SCRIPT_PYTHON) nolog
|
||||
$(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_ICONV) $(SCRIPT_LUA) $(SCRIPT_PYTHON) nolog
|
||||
-@ write sys$output " "
|
||||
-@ write sys$output "-----------------------------------------------"
|
||||
-@ write sys$output " All done"
|
||||
@@ -232,7 +225,6 @@ nolog :
|
||||
-@ write sys$output " HAVE_ODS5 = ""$(HAVE_ODS5)"" "
|
||||
-@ write sys$output " HAVE_GZIP = ""$(HAVE_GZIP)"" "
|
||||
-@ write sys$output " HAVE_GDIFF = ""$(HAVE_GDIFF)"" "
|
||||
-@ write sys$output " HAVE_CKSUM = ""$(HAVE_CKSUM)"" "
|
||||
-@ write sys$output " HAVE_ICONV = ""$(HAVE_ICONV)"" "
|
||||
-@ write sys$output " HAVE_LUA = ""$(HAVE_LUA)"" "
|
||||
-@ write sys$output " HAVE_PYTHON= ""$(HAVE_PYTHON)"" "
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
VimProg ?= ../vim
|
||||
|
||||
Scripts = test1.out test2.out test3.out test4.out test5.out test6.out
|
||||
test7.out test8.out test9.out test11.out
|
||||
test7.out test8.out test11.out
|
||||
test12.out test13.out test14.out test15.out test17.out
|
||||
test18.out test19.out test20.out test21.out test22.out
|
||||
test18.out test19.out test20.out test21.out
|
||||
test25.out test27.out
|
||||
test28.out test29.out test30.out test31.out test32.out
|
||||
test33.out test34.out test36.out test37.out
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
Tests for :let. vim: set ft=vim ts=8 :
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set runtimepath+=./sautest
|
||||
:" Test to not autoload when assigning. It causes internal error.
|
||||
:try
|
||||
: let Test104#numvar = function('tr')
|
||||
: $put ='OK: ' . string(Test104#numvar)
|
||||
:catch
|
||||
: $put ='FAIL: ' . v:exception
|
||||
:endtry
|
||||
:let a = 1
|
||||
:let b = 2
|
||||
:for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}']
|
||||
: try
|
||||
: redir => messages
|
||||
: execute 'let' letargs
|
||||
: redir END
|
||||
: $put ='OK:'
|
||||
: $put =split(substitute(messages, '\n', '\0 ', 'g'), '\n')
|
||||
: catch
|
||||
: $put ='FAIL: ' . v:exception
|
||||
: redir END
|
||||
: endtry
|
||||
:endfor
|
||||
:/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
Results of test104:
|
||||
@@ -1,13 +0,0 @@
|
||||
Results of test104:
|
||||
OK: function('tr')
|
||||
OK:
|
||||
a #1
|
||||
b #2
|
||||
OK:
|
||||
b #2
|
||||
OK:
|
||||
b #2
|
||||
a #1
|
||||
OK:
|
||||
a #1
|
||||
b #2
|
||||
@@ -1,13 +0,0 @@
|
||||
Tests for file with some lines ending in CTRL-M, some not
|
||||
|
||||
STARTTEST
|
||||
:set ta tx
|
||||
:e!
|
||||
:$-3,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
this lines ends in a
|
||||
this one doesn't
|
||||
this one does
|
||||
and the last one doesn't
|
||||
@@ -1,4 +0,0 @@
|
||||
this lines ends in a
|
||||
this one doesn't
|
||||
this one does
|
||||
and the last one doesn't
|
||||
@@ -1,31 +0,0 @@
|
||||
Inserts 2 million lines with consecutive integers starting from 1
|
||||
(essentially, the output of GNU's seq 1 2000000), writes them to Xtest
|
||||
and writes its cksum to test.out.
|
||||
|
||||
We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess
|
||||
up the lines the checksum would differ.
|
||||
|
||||
cksum is part of POSIX and so should be available on most Unixes.
|
||||
If it isn't available then the test will be skipped.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set belloff=all
|
||||
:if !executable("cksum")
|
||||
: e! test.ok
|
||||
: w! test.out
|
||||
: qa!
|
||||
:endif
|
||||
:set fileformat=unix undolevels=-1
|
||||
ggdG
|
||||
:let i = 1
|
||||
:while i <= 2000000 | call append(i, range(i, i + 99)) | let i += 100 | endwhile
|
||||
ggdd
|
||||
:w! Xtest
|
||||
:r !cksum Xtest
|
||||
:s/\s/ /g
|
||||
:set fileformat&
|
||||
:.w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
3678979763 14888896 Xtest
|
||||
@@ -1,35 +0,0 @@
|
||||
Tests for curswant not changing when setting an option
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:/^start target options$/+1,/^end target options$/-1 yank
|
||||
:let target_option_names = split(@0)
|
||||
:function TestCurswant(option_name)
|
||||
: normal! ggf8j
|
||||
: let curswant_before = winsaveview().curswant
|
||||
: execute 'let' '&'.a:option_name '=' '&'.a:option_name
|
||||
: let curswant_after = winsaveview().curswant
|
||||
: return [a:option_name, curswant_before, curswant_after]
|
||||
:endfunction
|
||||
:
|
||||
:new
|
||||
:put =['1234567890', '12345']
|
||||
:1 delete _
|
||||
:let result = []
|
||||
:for option_name in target_option_names
|
||||
: call add(result, TestCurswant(option_name))
|
||||
:endfor
|
||||
:
|
||||
:new
|
||||
:put =map(copy(result), 'join(v:val, '' '')')
|
||||
:1 delete _
|
||||
:write test.out
|
||||
:
|
||||
:qall!
|
||||
ENDTEST
|
||||
|
||||
start target options
|
||||
tabstop
|
||||
timeoutlen
|
||||
ttimeoutlen
|
||||
end target options
|
||||
@@ -1,3 +0,0 @@
|
||||
tabstop 7 4
|
||||
timeoutlen 7 7
|
||||
ttimeoutlen 7 7
|
||||
@@ -1,12 +0,0 @@
|
||||
Test for Bufleave autocommand that deletes the buffer we are about to edit.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:au BufLeave test9.in bwipe yy
|
||||
:e yy
|
||||
:/^start of/,$w! test.out " Write contents of this file
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of test file xx
|
||||
end of test file xx
|
||||
@@ -1,2 +0,0 @@
|
||||
start of test file xx
|
||||
end of test file xx
|
||||
@@ -1,43 +0,0 @@
|
||||
Test for 'scrollbind' causing an unexpected scroll of one of the windows.
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" We don't want the status line to cause problems:
|
||||
:set laststatus=0
|
||||
:let g:totalLines = &lines * 20
|
||||
:let middle = g:totalLines / 2
|
||||
:wincmd n
|
||||
:wincmd o
|
||||
:for i in range(1, g:totalLines)
|
||||
: call setline(i, 'LINE ' . i)
|
||||
:endfor
|
||||
:exe string(middle)
|
||||
:normal zt
|
||||
:normal M
|
||||
:aboveleft vert new
|
||||
:for i in range(1, g:totalLines)
|
||||
: call setline(i, 'line ' . i)
|
||||
:endfor
|
||||
:exe string(middle)
|
||||
:normal zt
|
||||
:normal M
|
||||
:" Execute the following two command at once to reproduce the problem.
|
||||
:setl scb | wincmd p
|
||||
:setl scb
|
||||
:wincmd w
|
||||
:let topLineLeft = line('w0')
|
||||
:wincmd p
|
||||
:let topLineRight = line('w0')
|
||||
:setl noscrollbind
|
||||
:wincmd p
|
||||
:setl noscrollbind
|
||||
:q!
|
||||
:%del _
|
||||
:call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight))
|
||||
:w! test.out
|
||||
:brewind
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Difference between the top lines (left - right): 0
|
||||
@@ -613,3 +613,22 @@ func Test_OptionSet_diffmode_close()
|
||||
call test_override('starting', 0)
|
||||
"delfunc! AutoCommandOptionSet
|
||||
endfunc
|
||||
|
||||
" Test for Bufleave autocommand that deletes the buffer we are about to edit.
|
||||
func Test_BufleaveWithDelete()
|
||||
new | edit Xfile1
|
||||
|
||||
augroup test_bufleavewithdelete
|
||||
autocmd!
|
||||
autocmd BufLeave Xfile1 bwipe Xfile2
|
||||
augroup END
|
||||
|
||||
call assert_fails('edit Xfile2', 'E143:')
|
||||
call assert_equal('Xfile1', bufname('%'))
|
||||
|
||||
autocmd! test_bufleavewithdelete BufLeave Xfile1
|
||||
augroup! test_bufleavewithdelete
|
||||
|
||||
new
|
||||
bwipe! Xfile1
|
||||
endfunc
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
" Tests for curswant not changing when setting an option
|
||||
|
||||
func Test_curswant()
|
||||
new
|
||||
call append(0, ['1234567890', '12345'])
|
||||
|
||||
normal! ggf8j
|
||||
call assert_equal(7, winsaveview().curswant)
|
||||
let &tabstop=&tabstop
|
||||
call assert_equal(4, winsaveview().curswant)
|
||||
|
||||
normal! ggf8j
|
||||
call assert_equal(7, winsaveview().curswant)
|
||||
let &timeoutlen=&timeoutlen
|
||||
call assert_equal(7, winsaveview().curswant)
|
||||
|
||||
normal! ggf8j
|
||||
call assert_equal(7, winsaveview().curswant)
|
||||
let &ttimeoutlen=&ttimeoutlen
|
||||
call assert_equal(7, winsaveview().curswant)
|
||||
|
||||
enew!
|
||||
endfunc
|
||||
@@ -0,0 +1,30 @@
|
||||
" Inserts 2 million lines with consecutive integers starting from 1
|
||||
" (essentially, the output of GNU's seq 1 2000000), writes them to Xtest
|
||||
" and writes its cksum to test.out.
|
||||
"
|
||||
" We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess
|
||||
" up the lines the checksum would differ.
|
||||
"
|
||||
" cksum is part of POSIX and so should be available on most Unixes.
|
||||
" If it isn't available then the test will be skipped.
|
||||
func Test_File_Size()
|
||||
if !executable('cksum')
|
||||
return
|
||||
endif
|
||||
|
||||
new
|
||||
set belloff=all fileformat=unix undolevels=-1
|
||||
for i in range(1, 2000000, 100)
|
||||
call append(i, range(i, i + 99))
|
||||
endfor
|
||||
|
||||
1delete
|
||||
w! Xtest
|
||||
let res = systemlist('cksum Xtest')[0]
|
||||
let res = substitute(res, "\r", "", "")
|
||||
call assert_equal('3678979763 14888896 Xtest', res)
|
||||
|
||||
enew!
|
||||
call delete('Xtest')
|
||||
set belloff& fileformat& undolevels&
|
||||
endfunc
|
||||
@@ -0,0 +1,27 @@
|
||||
" Tests for the :let command.
|
||||
|
||||
func Test_let()
|
||||
" Test to not autoload when assigning. It causes internal error.
|
||||
set runtimepath+=./sautest
|
||||
let Test104#numvar = function('tr')
|
||||
call assert_equal("function('tr')", string(Test104#numvar))
|
||||
|
||||
let a = 1
|
||||
let b = 2
|
||||
|
||||
let out = execute('let a b')
|
||||
let s = "\na #1\nb #2"
|
||||
call assert_equal(s, out)
|
||||
|
||||
let out = execute('let {0 == 1 ? "a" : "b"}')
|
||||
let s = "\nb #2"
|
||||
call assert_equal(s, out)
|
||||
|
||||
let out = execute('let {0 == 1 ? "a" : "b"} a')
|
||||
let s = "\nb #2\na #1"
|
||||
call assert_equal(s, out)
|
||||
|
||||
let out = execute('let a {0 == 1 ? "a" : "b"}')
|
||||
let s = "\na #1\nb #2"
|
||||
call assert_equal(s, out)
|
||||
endfunc
|
||||
@@ -0,0 +1,19 @@
|
||||
" Tests for saving/loading a file with some lines ending in
|
||||
" CTRL-M, some not
|
||||
func Test_lineending()
|
||||
let l = ["this line ends in a\<CR>",
|
||||
\ "this one doesn't",
|
||||
\ "this one does\<CR>",
|
||||
\ "and the last one doesn't"]
|
||||
set ta tx
|
||||
enew!
|
||||
call append(0, l)
|
||||
$delete
|
||||
write Xfile1
|
||||
bwipe Xfile1
|
||||
edit Xfile1
|
||||
let t = getline(1, '$')
|
||||
call assert_equal(l, t)
|
||||
new | only
|
||||
call delete('Xfile1')
|
||||
endfunc
|
||||
@@ -0,0 +1,32 @@
|
||||
" Test for 'scrollbind' causing an unexpected scroll of one of the windows.
|
||||
func Test_scrollbind()
|
||||
" We don't want the status line to cause problems:
|
||||
set laststatus=0
|
||||
let totalLines = &lines * 20
|
||||
let middle = totalLines / 2
|
||||
new | only
|
||||
for i in range(1, totalLines)
|
||||
call setline(i, 'LINE ' . i)
|
||||
endfor
|
||||
exe string(middle)
|
||||
normal zt
|
||||
normal M
|
||||
aboveleft vert new
|
||||
for i in range(1, totalLines)
|
||||
call setline(i, 'line ' . i)
|
||||
endfor
|
||||
exe string(middle)
|
||||
normal zt
|
||||
normal M
|
||||
" Execute the following two commands at once to reproduce the problem.
|
||||
setl scb | wincmd p
|
||||
setl scb
|
||||
wincmd w
|
||||
let topLineLeft = line('w0')
|
||||
wincmd p
|
||||
let topLineRight = line('w0')
|
||||
setl noscrollbind
|
||||
wincmd p
|
||||
setl noscrollbind
|
||||
call assert_equal(0, topLineLeft - topLineRight)
|
||||
endfunc
|
||||
@@ -784,6 +784,14 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
862,
|
||||
/**/
|
||||
861,
|
||||
/**/
|
||||
860,
|
||||
/**/
|
||||
859,
|
||||
/**/
|
||||
858,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user