mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
Merge branch 'master' of https://github.com/neovim/neovim into vim-8.0.0101
fix Conflicts
This commit is contained in:
@@ -8810,11 +8810,12 @@ makeopens (
|
|||||||
&& buf->b_fname != NULL
|
&& buf->b_fname != NULL
|
||||||
&& buf->b_p_bl) {
|
&& buf->b_p_bl) {
|
||||||
if (fprintf(fd, "badd +%" PRId64 " ",
|
if (fprintf(fd, "badd +%" PRId64 " ",
|
||||||
buf->b_wininfo == NULL ?
|
buf->b_wininfo == NULL
|
||||||
(int64_t)1L :
|
? (int64_t)1L
|
||||||
(int64_t)buf->b_wininfo->wi_fpos.lnum) < 0
|
: (int64_t)buf->b_wininfo->wi_fpos.lnum) < 0
|
||||||
|| ses_fname(fd, buf, &ssop_flags) == FAIL)
|
|| ses_fname(fd, buf, &ssop_flags, true) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8885,11 +8886,13 @@ makeopens (
|
|||||||
&& !bt_nofile(wp->w_buffer)
|
&& !bt_nofile(wp->w_buffer)
|
||||||
) {
|
) {
|
||||||
if (fputs(need_tabnew ? "tabedit " : "edit ", fd) < 0
|
if (fputs(need_tabnew ? "tabedit " : "edit ", fd) < 0
|
||||||
|| ses_fname(fd, wp->w_buffer, &ssop_flags) == FAIL)
|
|| ses_fname(fd, wp->w_buffer, &ssop_flags, true) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
need_tabnew = FALSE;
|
}
|
||||||
if (!wp->w_arg_idx_invalid)
|
need_tabnew = false;
|
||||||
|
if (!wp->w_arg_idx_invalid) {
|
||||||
edited_win = wp;
|
edited_win = wp;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8933,6 +8936,8 @@ makeopens (
|
|||||||
// resized when moving between windows.
|
// resized when moving between windows.
|
||||||
// Do this before restoring the view, so that the topline and the
|
// Do this before restoring the view, so that the topline and the
|
||||||
// cursor can be set. This is done again below.
|
// cursor can be set. This is done again below.
|
||||||
|
// winminheight and winminwidth need to be set to avoid an error if the
|
||||||
|
// user has set winheight or winwidth.
|
||||||
if (put_line(fd, "set winminheight=1 winminwidth=1 winheight=1 winwidth=1")
|
if (put_line(fd, "set winminheight=1 winminwidth=1 winheight=1 winwidth=1")
|
||||||
== FAIL) {
|
== FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -9221,24 +9226,35 @@ put_view (
|
|||||||
if (wp->w_buffer->b_ffname != NULL
|
if (wp->w_buffer->b_ffname != NULL
|
||||||
&& (!bt_nofile(wp->w_buffer) || wp->w_buffer->terminal)
|
&& (!bt_nofile(wp->w_buffer) || wp->w_buffer->terminal)
|
||||||
) {
|
) {
|
||||||
/*
|
// Editing a file in this buffer: use ":edit file".
|
||||||
* Editing a file in this buffer: use ":edit file".
|
// This may have side effects! (e.g., compressed or network file).
|
||||||
* This may have side effects! (e.g., compressed or network file).
|
//
|
||||||
*/
|
// Note, if a buffer for that file already exists, use :badd to
|
||||||
if (fputs("edit ", fd) < 0
|
// edit that buffer, to not lose folding information (:edit resets
|
||||||
|| ses_fname(fd, wp->w_buffer, flagp) == FAIL)
|
// folds in other buffers)
|
||||||
|
if (fputs("if bufexists('", fd) < 0
|
||||||
|
|| ses_fname(fd, wp->w_buffer, flagp, false) == FAIL
|
||||||
|
|| fputs("') | buffer ", fd) < 0
|
||||||
|
|| ses_fname(fd, wp->w_buffer, flagp, false) == FAIL
|
||||||
|
|| fputs(" | else | edit ", fd) < 0
|
||||||
|
|| ses_fname(fd, wp->w_buffer, flagp, false) == FAIL
|
||||||
|
|| fputs(" | endif", fd) < 0
|
||||||
|
|| put_eol(fd) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
} else {
|
|
||||||
/* No file in this buffer, just make it empty. */
|
|
||||||
if (put_line(fd, "enew") == FAIL)
|
|
||||||
return FAIL;
|
|
||||||
if (wp->w_buffer->b_ffname != NULL) {
|
|
||||||
/* The buffer does have a name, but it's not a file name. */
|
|
||||||
if (fputs("file ", fd) < 0
|
|
||||||
|| ses_fname(fd, wp->w_buffer, flagp) == FAIL)
|
|
||||||
return FAIL;
|
|
||||||
}
|
}
|
||||||
do_cursor = FALSE;
|
} else {
|
||||||
|
// No file in this buffer, just make it empty.
|
||||||
|
if (put_line(fd, "enew") == FAIL) {
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
if (wp->w_buffer->b_ffname != NULL) {
|
||||||
|
// The buffer does have a name, but it's not a file name.
|
||||||
|
if (fputs("file ", fd) < 0
|
||||||
|
|| ses_fname(fd, wp->w_buffer, flagp, true) == FAIL) {
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
do_cursor = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9389,12 +9405,10 @@ ses_arglist (
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/// Write a buffer name to the session file.
|
||||||
* Write a buffer name to the session file.
|
/// Also ends the line, if "add_eol" is true.
|
||||||
* Also ends the line.
|
/// Returns FAIL if writing fails.
|
||||||
* Returns FAIL if writing fails.
|
static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp, bool add_eol)
|
||||||
*/
|
|
||||||
static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp)
|
|
||||||
{
|
{
|
||||||
char_u *name;
|
char_u *name;
|
||||||
|
|
||||||
@@ -9411,8 +9425,10 @@ static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp)
|
|||||||
name = buf->b_sfname;
|
name = buf->b_sfname;
|
||||||
else
|
else
|
||||||
name = buf->b_ffname;
|
name = buf->b_ffname;
|
||||||
if (ses_put_fname(fd, name, flagp) == FAIL || put_eol(fd) == FAIL)
|
if (ses_put_fname(fd, name, flagp) == FAIL
|
||||||
|
|| (add_eol && put_eol(fd) == FAIL)) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1146,8 +1146,9 @@ EXTERN char_u e_winheight[] INIT(= N_(
|
|||||||
EXTERN char_u e_winwidth[] INIT(= N_(
|
EXTERN char_u e_winwidth[] INIT(= N_(
|
||||||
"E592: 'winwidth' cannot be smaller than 'winminwidth'"));
|
"E592: 'winwidth' cannot be smaller than 'winminwidth'"));
|
||||||
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
|
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
|
||||||
EXTERN char_u e_zerocount[] INIT(= N_("Zero count"));
|
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
|
||||||
EXTERN char_u e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context"));
|
EXTERN char_u e_usingsid[] INIT(= N_(
|
||||||
|
"E81: Using <SID> not in a script context"));
|
||||||
EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s"));
|
EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s"));
|
||||||
EXTERN char_u e_maxmempat[] INIT(= N_(
|
EXTERN char_u e_maxmempat[] INIT(= N_(
|
||||||
"E363: pattern uses more memory than 'maxmempattern'"));
|
"E363: pattern uses more memory than 'maxmempattern'"));
|
||||||
|
@@ -3001,9 +3001,10 @@ did_set_string_option (
|
|||||||
if (s[-1] == 'k' || s[-1] == 's') {
|
if (s[-1] == 'k' || s[-1] == 's') {
|
||||||
/* skip optional filename after 'k' and 's' */
|
/* skip optional filename after 'k' and 's' */
|
||||||
while (*s && *s != ',' && *s != ' ') {
|
while (*s && *s != ',' && *s != ' ') {
|
||||||
if (*s == '\\')
|
if (*s == '\\' && s[1] != NUL) {
|
||||||
++s;
|
s++;
|
||||||
++s;
|
}
|
||||||
|
s++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (errbuf != NULL) {
|
if (errbuf != NULL) {
|
||||||
|
@@ -3557,11 +3557,15 @@ extend:
|
|||||||
--start_lnum;
|
--start_lnum;
|
||||||
|
|
||||||
if (VIsual_active) {
|
if (VIsual_active) {
|
||||||
/* Problem: when doing "Vipipip" nothing happens in a single white
|
// Problem: when doing "Vipipip" nothing happens in a single white
|
||||||
* line, we get stuck there. Trap this here. */
|
// line, we get stuck there. Trap this here.
|
||||||
if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum)
|
if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum) {
|
||||||
goto extend;
|
goto extend;
|
||||||
VIsual.lnum = start_lnum;
|
}
|
||||||
|
if (VIsual.lnum != start_lnum) {
|
||||||
|
VIsual.lnum = start_lnum;
|
||||||
|
VIsual.col = 0;
|
||||||
|
}
|
||||||
VIsual_mode = 'V';
|
VIsual_mode = 'V';
|
||||||
redraw_curbuf_later(INVERTED); /* update the inversion */
|
redraw_curbuf_later(INVERTED); /* update the inversion */
|
||||||
showmode();
|
showmode();
|
||||||
|
@@ -89,17 +89,8 @@ func s:doc_config_teardown()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func s:get_cmd_compl_list(cmd)
|
func s:get_help_compl_list(cmd)
|
||||||
let list = []
|
return getcompletion(a:cmd, 'help')
|
||||||
let str = ''
|
|
||||||
for cnt in range(1, 999)
|
|
||||||
call feedkeys(a:cmd . repeat("\<Tab>", cnt) . "'\<C-B>let str='\<CR>", 'tx')
|
|
||||||
if str ==# a:cmd[1:]
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
call add(list, str)
|
|
||||||
endfor
|
|
||||||
return list
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_help_complete()
|
func Test_help_complete()
|
||||||
@@ -111,49 +102,49 @@ func Test_help_complete()
|
|||||||
if has('multi_lang')
|
if has('multi_lang')
|
||||||
set helplang=
|
set helplang=
|
||||||
endif
|
endif
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(['h test-col', 'h test-char'], list)
|
call assert_equal(['test-col', 'test-char'], list)
|
||||||
|
|
||||||
if has('multi_lang')
|
if has('multi_lang')
|
||||||
" 'helplang=ab' and help file lang is 'en'
|
" 'helplang=ab' and help file lang is 'en'
|
||||||
set helplang=ab
|
set helplang=ab
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(['h test-col', 'h test-char'], list)
|
call assert_equal(['test-col', 'test-char'], list)
|
||||||
|
|
||||||
" 'helplang=' and help file lang is 'en' and 'ab'
|
" 'helplang=' and help file lang is 'en' and 'ab'
|
||||||
set rtp+=Xdir1/doc-ab
|
set rtp+=Xdir1/doc-ab
|
||||||
set helplang=
|
set helplang=
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(sort(['h test-col@en', 'h test-col@ab',
|
call assert_equal(sort(['test-col@en', 'test-col@ab',
|
||||||
\ 'h test-char@en', 'h test-char@ab']), sort(list))
|
\ 'test-char@en', 'test-char@ab']), sort(list))
|
||||||
|
|
||||||
" 'helplang=ab' and help file lang is 'en' and 'ab'
|
" 'helplang=ab' and help file lang is 'en' and 'ab'
|
||||||
set helplang=ab
|
set helplang=ab
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(sort(['h test-col', 'h test-col@en',
|
call assert_equal(sort(['test-col', 'test-col@en',
|
||||||
\ 'h test-char', 'h test-char@en']), sort(list))
|
\ 'test-char', 'test-char@en']), sort(list))
|
||||||
|
|
||||||
" 'helplang=' and help file lang is 'en', 'ab' and 'ja'
|
" 'helplang=' and help file lang is 'en', 'ab' and 'ja'
|
||||||
set rtp+=Xdir1/doc-ja
|
set rtp+=Xdir1/doc-ja
|
||||||
set helplang=
|
set helplang=
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(sort(['h test-col@en', 'h test-col@ab',
|
call assert_equal(sort(['test-col@en', 'test-col@ab',
|
||||||
\ 'h test-col@ja', 'h test-char@en',
|
\ 'test-col@ja', 'test-char@en',
|
||||||
\ 'h test-char@ab', 'h test-char@ja']), sort(list))
|
\ 'test-char@ab', 'test-char@ja']), sort(list))
|
||||||
|
|
||||||
" 'helplang=ab' and help file lang is 'en', 'ab' and 'ja'
|
" 'helplang=ab' and help file lang is 'en', 'ab' and 'ja'
|
||||||
set helplang=ab
|
set helplang=ab
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(sort(['h test-col', 'h test-col@en',
|
call assert_equal(sort(['test-col', 'test-col@en',
|
||||||
\ 'h test-col@ja', 'h test-char',
|
\ 'test-col@ja', 'test-char',
|
||||||
\ 'h test-char@en', 'h test-char@ja']), sort(list))
|
\ 'test-char@en', 'test-char@ja']), sort(list))
|
||||||
|
|
||||||
" 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja'
|
" 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja'
|
||||||
set helplang=ab,ja
|
set helplang=ab,ja
|
||||||
let list = s:get_cmd_compl_list(":h test")
|
let list = s:get_help_compl_list("test")
|
||||||
call assert_equal(sort(['h test-col', 'h test-col@ja',
|
call assert_equal(sort(['test-col', 'test-col@ja',
|
||||||
\ 'h test-col@en', 'h test-char',
|
\ 'test-col@en', 'test-char',
|
||||||
\ 'h test-char@ja', 'h test-char@en']), sort(list))
|
\ 'test-char@ja', 'test-char@en']), sort(list))
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
call assert_exception('X')
|
call assert_exception('X')
|
||||||
|
@@ -1,4 +1,113 @@
|
|||||||
" Tests for sessions
|
" Test for :mksession, :mkview and :loadview in latin1 encoding
|
||||||
|
|
||||||
|
scriptencoding latin1
|
||||||
|
|
||||||
|
if !has('multi_byte') || !has('mksession')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
func Test_mksession()
|
||||||
|
tabnew
|
||||||
|
let wrap_save = &wrap
|
||||||
|
set sessionoptions=buffers splitbelow fileencoding=latin1
|
||||||
|
call setline(1, [
|
||||||
|
\ 'start:',
|
||||||
|
\ 'no multibyte chAracter',
|
||||||
|
\ ' one leaDing tab',
|
||||||
|
\ ' four leadinG spaces',
|
||||||
|
\ 'two consecutive tabs',
|
||||||
|
\ 'two tabs in one line',
|
||||||
|
\ 'one <20> multibyteCharacter',
|
||||||
|
\ 'a<> <20> two multiByte characters',
|
||||||
|
\ 'A<><41><EFBFBD> three mulTibyte characters'
|
||||||
|
\ ])
|
||||||
|
let tmpfile = 'Xtemp'
|
||||||
|
exec 'w! ' . tmpfile
|
||||||
|
/^start:
|
||||||
|
set wrap
|
||||||
|
vsplit
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j8|
|
||||||
|
split
|
||||||
|
norm! j8|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
wincmd l
|
||||||
|
|
||||||
|
set nowrap
|
||||||
|
/^start:
|
||||||
|
norm! j16|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j08|3zl
|
||||||
|
split
|
||||||
|
norm! j08|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
call wincol()
|
||||||
|
mksession! Xtest_mks.out
|
||||||
|
let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
|
||||||
|
let expected = [
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 08|',
|
||||||
|
\ 'normal! 08|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
|
||||||
|
\ " normal! 08|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
|
||||||
|
\ " normal! 08|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|"
|
||||||
|
\ ]
|
||||||
|
call assert_equal(expected, li)
|
||||||
|
tabclose!
|
||||||
|
|
||||||
|
call delete('Xtest_mks.out')
|
||||||
|
call delete(tmpfile)
|
||||||
|
let &wrap = wrap_save
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_mksession_winheight()
|
||||||
|
new
|
||||||
|
set winheight=10 winminheight=2
|
||||||
|
mksession! Xtest_mks.out
|
||||||
|
source Xtest_mks.out
|
||||||
|
|
||||||
|
call delete('Xtest_mks.out')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Verify that arglist is stored correctly to the session file.
|
" Verify that arglist is stored correctly to the session file.
|
||||||
func Test_mksession_arglist()
|
func Test_mksession_arglist()
|
||||||
@@ -12,4 +121,35 @@ func Test_mksession_arglist()
|
|||||||
argdel *
|
argdel *
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_mksession_one_buffer_two_windows()
|
||||||
|
edit Xtest1
|
||||||
|
new Xtest2
|
||||||
|
split
|
||||||
|
mksession! Xtest_mks.out
|
||||||
|
let lines = readfile('Xtest_mks.out')
|
||||||
|
let count1 = 0
|
||||||
|
let count2 = 0
|
||||||
|
let count2buf = 0
|
||||||
|
for line in lines
|
||||||
|
if line =~ 'edit \f*Xtest1$'
|
||||||
|
let count1 += 1
|
||||||
|
endif
|
||||||
|
if line =~ 'edit \f\{-}Xtest2'
|
||||||
|
let count2 += 1
|
||||||
|
endif
|
||||||
|
if line =~ 'buffer \f\{-}Xtest2'
|
||||||
|
let count2buf += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
call assert_equal(1, count1, 'Xtest1 count')
|
||||||
|
call assert_equal(2, count2, 'Xtest2 count')
|
||||||
|
call assert_equal(2, count2buf, 'Xtest2 buffer count')
|
||||||
|
|
||||||
|
close
|
||||||
|
bwipe!
|
||||||
|
call delete('Xtest_mks.out')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
104
src/nvim/testdir/test_mksession_utf8.vim
Normal file
104
src/nvim/testdir/test_mksession_utf8.vim
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
" Test for :mksession, :mkview and :loadview in utf-8 encoding
|
||||||
|
|
||||||
|
set encoding=utf-8
|
||||||
|
scriptencoding utf-8
|
||||||
|
|
||||||
|
if !has('multi_byte') || !has('mksession')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
func Test_mksession_utf8()
|
||||||
|
tabnew
|
||||||
|
let wrap_save = &wrap
|
||||||
|
set sessionoptions=buffers splitbelow fileencoding=utf-8
|
||||||
|
call setline(1, [
|
||||||
|
\ 'start:',
|
||||||
|
\ 'no multibyte chAracter',
|
||||||
|
\ ' one leaDing tab',
|
||||||
|
\ ' four leadinG spaces',
|
||||||
|
\ 'two consecutive tabs',
|
||||||
|
\ 'two tabs in one line',
|
||||||
|
\ 'one … multibyteCharacter',
|
||||||
|
\ 'a “b” two multiByte characters',
|
||||||
|
\ '“c”1€ three mulTibyte characters'
|
||||||
|
\ ])
|
||||||
|
let tmpfile = tempname()
|
||||||
|
exec 'w! ' . tmpfile
|
||||||
|
/^start:
|
||||||
|
set wrap
|
||||||
|
vsplit
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j8|
|
||||||
|
split
|
||||||
|
norm! j8|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
split
|
||||||
|
norm! j16|
|
||||||
|
wincmd l
|
||||||
|
|
||||||
|
set nowrap
|
||||||
|
/^start:
|
||||||
|
norm! j16|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j08|3zl
|
||||||
|
split
|
||||||
|
norm! j08|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
norm! j016|3zl
|
||||||
|
split
|
||||||
|
call wincol()
|
||||||
|
mksession! test_mks.out
|
||||||
|
let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
|
||||||
|
let expected = [
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 08|',
|
||||||
|
\ 'normal! 08|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ 'normal! 016|',
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
|
||||||
|
\ " normal! 08|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
|
||||||
|
\ " normal! 08|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|",
|
||||||
|
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
|
||||||
|
\ " normal! 016|"
|
||||||
|
\ ]
|
||||||
|
call assert_equal(expected, li)
|
||||||
|
tabclose!
|
||||||
|
|
||||||
|
call delete('test_mks.out')
|
||||||
|
call delete(tmpfile)
|
||||||
|
let &wrap = wrap_save
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" vim: shiftwidth=2 sts=2 expandtab
|
@@ -126,3 +126,13 @@ endfunc
|
|||||||
func Test_thesaurus()
|
func Test_thesaurus()
|
||||||
call Check_dir_option('thesaurus')
|
call Check_dir_option('thesaurus')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_complete()
|
||||||
|
" Trailing single backslash used to cause invalid memory access.
|
||||||
|
set complete=s\
|
||||||
|
new
|
||||||
|
call feedkeys("i\<C-N>\<Esc>", 'xt')
|
||||||
|
bwipe!
|
||||||
|
set complete&
|
||||||
|
endfun
|
||||||
|
|
||||||
|
@@ -28,3 +28,10 @@ func Test_Visual_ctrl_o()
|
|||||||
set tw&
|
set tw&
|
||||||
bw!
|
bw!
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
|
func Test_Visual_vapo()
|
||||||
|
new
|
||||||
|
normal oxx
|
||||||
|
normal vapo
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
@@ -77,6 +77,157 @@ static char *features[] = {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const int included_patches[] = {
|
static const int included_patches[] = {
|
||||||
|
// 1026,
|
||||||
|
1025,
|
||||||
|
1024,
|
||||||
|
// 1023,
|
||||||
|
// 1022,
|
||||||
|
// 1021,
|
||||||
|
// 1020,
|
||||||
|
// 1019,
|
||||||
|
// 1018,
|
||||||
|
// 1017,
|
||||||
|
// 1016,
|
||||||
|
// 1015,
|
||||||
|
// 1014,
|
||||||
|
// 1013,
|
||||||
|
// 1012,
|
||||||
|
// 1011,
|
||||||
|
// 1010,
|
||||||
|
// 1009,
|
||||||
|
// 1008,
|
||||||
|
// 1007,
|
||||||
|
// 1006,
|
||||||
|
// 1005,
|
||||||
|
// 1004,
|
||||||
|
// 1003,
|
||||||
|
// 1002,
|
||||||
|
// 1001,
|
||||||
|
// 1000,
|
||||||
|
// 999,
|
||||||
|
// 998,
|
||||||
|
// 997,
|
||||||
|
// 996,
|
||||||
|
// 995,
|
||||||
|
// 994,
|
||||||
|
// 993,
|
||||||
|
// 992,
|
||||||
|
// 991,
|
||||||
|
// 990,
|
||||||
|
// 989,
|
||||||
|
// 988,
|
||||||
|
// 987,
|
||||||
|
// 986,
|
||||||
|
// 985,
|
||||||
|
// 984,
|
||||||
|
// 983,
|
||||||
|
// 982,
|
||||||
|
// 981,
|
||||||
|
// 980,
|
||||||
|
// 979,
|
||||||
|
// 978,
|
||||||
|
// 977,
|
||||||
|
// 976,
|
||||||
|
// 975,
|
||||||
|
// 974,
|
||||||
|
// 973,
|
||||||
|
// 972,
|
||||||
|
// 971,
|
||||||
|
// 970,
|
||||||
|
// 969,
|
||||||
|
// 968,
|
||||||
|
// 967,
|
||||||
|
// 966,
|
||||||
|
// 965,
|
||||||
|
// 964,
|
||||||
|
// 963,
|
||||||
|
// 962,
|
||||||
|
// 961,
|
||||||
|
// 960,
|
||||||
|
// 959,
|
||||||
|
// 958,
|
||||||
|
// 957,
|
||||||
|
// 956,
|
||||||
|
// 955,
|
||||||
|
// 954,
|
||||||
|
// 953,
|
||||||
|
// 952,
|
||||||
|
// 951,
|
||||||
|
// 950,
|
||||||
|
// 949,
|
||||||
|
// 948,
|
||||||
|
// 947,
|
||||||
|
// 946,
|
||||||
|
// 945,
|
||||||
|
// 944,
|
||||||
|
// 943,
|
||||||
|
// 942,
|
||||||
|
// 941,
|
||||||
|
// 940,
|
||||||
|
// 939,
|
||||||
|
// 938,
|
||||||
|
// 937,
|
||||||
|
// 936,
|
||||||
|
// 935,
|
||||||
|
// 934,
|
||||||
|
// 933,
|
||||||
|
// 932,
|
||||||
|
// 931,
|
||||||
|
// 930,
|
||||||
|
// 929,
|
||||||
|
// 928,
|
||||||
|
// 927,
|
||||||
|
// 926,
|
||||||
|
// 925,
|
||||||
|
// 924,
|
||||||
|
// 923,
|
||||||
|
// 922,
|
||||||
|
// 921,
|
||||||
|
// 920,
|
||||||
|
// 919,
|
||||||
|
// 918,
|
||||||
|
// 917,
|
||||||
|
// 916,
|
||||||
|
// 915,
|
||||||
|
// 914,
|
||||||
|
// 913,
|
||||||
|
// 912,
|
||||||
|
// 911,
|
||||||
|
// 910,
|
||||||
|
// 909,
|
||||||
|
// 908,
|
||||||
|
// 907,
|
||||||
|
// 906,
|
||||||
|
// 905,
|
||||||
|
// 904,
|
||||||
|
// 903,
|
||||||
|
// 902,
|
||||||
|
// 901,
|
||||||
|
// 900,
|
||||||
|
// 899,
|
||||||
|
// 898,
|
||||||
|
// 897,
|
||||||
|
// 896,
|
||||||
|
// 895,
|
||||||
|
// 894,
|
||||||
|
// 893,
|
||||||
|
// 892,
|
||||||
|
// 891,
|
||||||
|
// 890,
|
||||||
|
// 889,
|
||||||
|
// 888,
|
||||||
|
// 887,
|
||||||
|
// 886,
|
||||||
|
// 885,
|
||||||
|
// 884,
|
||||||
|
// 883,
|
||||||
|
// 882,
|
||||||
|
// 881,
|
||||||
|
// 880,
|
||||||
|
// 879,
|
||||||
|
// 878,
|
||||||
|
// 877,
|
||||||
|
// 876,
|
||||||
// 875,
|
// 875,
|
||||||
// 874,
|
// 874,
|
||||||
// 873,
|
// 873,
|
||||||
@@ -619,12 +770,12 @@ static const int included_patches[] = {
|
|||||||
// 336,
|
// 336,
|
||||||
// 335,
|
// 335,
|
||||||
// 334,
|
// 334,
|
||||||
// 333,
|
333,
|
||||||
// 332,
|
// 332,
|
||||||
331,
|
331,
|
||||||
// 330,
|
330,
|
||||||
// 329,
|
// 329,
|
||||||
// 328,
|
328,
|
||||||
327,
|
327,
|
||||||
326,
|
326,
|
||||||
325,
|
325,
|
||||||
@@ -694,12 +845,12 @@ static const int included_patches[] = {
|
|||||||
// 261,
|
// 261,
|
||||||
// 260 NA
|
// 260 NA
|
||||||
259,
|
259,
|
||||||
// 258,
|
258,
|
||||||
// 257 NA
|
// 257 NA
|
||||||
// 256,
|
// 256,
|
||||||
// 255,
|
// 255,
|
||||||
// 254,
|
// 254,
|
||||||
// 253,
|
253,
|
||||||
// 252,
|
// 252,
|
||||||
// 251,
|
// 251,
|
||||||
250,
|
250,
|
||||||
@@ -840,7 +991,7 @@ static const int included_patches[] = {
|
|||||||
// 115 NA
|
// 115 NA
|
||||||
// 114 NA
|
// 114 NA
|
||||||
// 113 NA
|
// 113 NA
|
||||||
// 112,
|
112,
|
||||||
111,
|
111,
|
||||||
110,
|
110,
|
||||||
// 109 NA
|
// 109 NA
|
||||||
@@ -861,7 +1012,7 @@ static const int included_patches[] = {
|
|||||||
// 94 NA
|
// 94 NA
|
||||||
// 93 NA
|
// 93 NA
|
||||||
92,
|
92,
|
||||||
// 91,
|
91,
|
||||||
90,
|
90,
|
||||||
// 89 NA
|
// 89 NA
|
||||||
88,
|
88,
|
||||||
|
@@ -17,4 +17,4 @@ ignore = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Ignore whitespace issues in converted Vim legacy tests.
|
-- Ignore whitespace issues in converted Vim legacy tests.
|
||||||
files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }}
|
--files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }}
|
||||||
|
@@ -15,6 +15,8 @@ local function insert_(content)
|
|||||||
feed_command('1', 'set cin ts=4 sw=4')
|
feed_command('1', 'set cin ts=4 sw=4')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
describe('cindent', function()
|
describe('cindent', function()
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@ local wait = helpers.wait
|
|||||||
describe('test5', function()
|
describe('test5', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
start of test file Xxx
|
start of test file Xxx
|
||||||
|
@@ -94,6 +94,8 @@ describe('file reading, writing and bufnew and filter autocommands', function()
|
|||||||
eq(gzip_data, io.open('Xtestfile.gz'):read('*all'))
|
eq(gzip_data, io.open('Xtestfile.gz'):read('*all'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
|
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||||
it('FileReadPre, FileReadPost', function()
|
it('FileReadPre, FileReadPost', function()
|
||||||
prepare_gz_file('Xtestfile', text1)
|
prepare_gz_file('Xtestfile', text1)
|
||||||
feed_command('au! FileReadPre *.gz exe "silent !gzip -d " . shellescape(expand("<afile>"))')
|
feed_command('au! FileReadPre *.gz exe "silent !gzip -d " . shellescape(expand("<afile>"))')
|
||||||
|
@@ -9,6 +9,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
|||||||
describe('alignment', function()
|
describe('alignment', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
test for :left
|
test for :left
|
||||||
|
@@ -8,6 +8,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
|||||||
describe([[performing "r<Tab>" with 'smarttab' and 'expandtab' set/not set, and "dv_"]], function()
|
describe([[performing "r<Tab>" with 'smarttab' and 'expandtab' set/not set, and "dv_"]], function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
start text
|
start text
|
||||||
|
@@ -11,6 +11,8 @@ local feed_command = helpers.feed_command
|
|||||||
describe('joining lines', function()
|
describe('joining lines', function()
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespaces in a string)
|
||||||
|
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||||
it("keeps marks with different 'joinspaces' settings", function()
|
it("keeps marks with different 'joinspaces' settings", function()
|
||||||
insert([[
|
insert([[
|
||||||
firstline
|
firstline
|
||||||
|
@@ -9,6 +9,7 @@ local wait = helpers.wait
|
|||||||
describe('lisp indent', function()
|
describe('lisp indent', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
(defun html-file (base)
|
(defun html-file (base)
|
||||||
|
@@ -7,6 +7,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
|||||||
describe('Virtual replace mode', function()
|
describe('Virtual replace mode', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
-- Make sure that backspace works, no matter what termcap is used.
|
-- Make sure that backspace works, no matter what termcap is used.
|
||||||
feed_command('set t_kD=x7f t_kb=x08')
|
feed_command('set t_kD=x7f t_kb=x08')
|
||||||
|
@@ -43,6 +43,7 @@ describe('Visual block mode', function()
|
|||||||
abcdqqqqijklm]])
|
abcdqqqqijklm]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||||
it('should insert a block using cursor keys for movement', function()
|
it('should insert a block using cursor keys for movement', function()
|
||||||
insert([[
|
insert([[
|
||||||
aaaaaa
|
aaaaaa
|
||||||
@@ -104,6 +105,7 @@ describe('Visual block mode', function()
|
|||||||
456ab7]])
|
456ab7]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('should insert and append a block when virtualedit=all', function()
|
it('should insert and append a block when virtualedit=all', function()
|
||||||
insert([[
|
insert([[
|
||||||
line1
|
line1
|
||||||
|
@@ -191,6 +191,7 @@ describe('list and dictionary types', function()
|
|||||||
[3]]=])
|
[3]]=])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it('assignment to a list', function()
|
it('assignment to a list', function()
|
||||||
source([[
|
source([[
|
||||||
let l = [0, 1, 2, 3]
|
let l = [0, 1, 2, 3]
|
||||||
|
@@ -9,6 +9,7 @@ local expect = helpers.expect
|
|||||||
describe('text formatting', function()
|
describe('text formatting', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
-- The control character <C-A> (byte \x01) needs to be put in the buffer
|
-- The control character <C-A> (byte \x01) needs to be put in the buffer
|
||||||
-- directly. But the insert function sends the text to nvim in insert
|
-- directly. But the insert function sends the text to nvim in insert
|
||||||
|
@@ -7,6 +7,7 @@ local feed_command, expect = helpers.feed_command, helpers.expect
|
|||||||
describe('coptions', function()
|
describe('coptions', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
aaa two three four
|
aaa two three four
|
||||||
|
@@ -7,6 +7,7 @@ local clear, expect = helpers.clear, helpers.expect
|
|||||||
describe('curswant', function()
|
describe('curswant', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
start target options
|
start target options
|
||||||
|
@@ -12,6 +12,7 @@ end
|
|||||||
describe('cursor and column position with conceal and tabulators', function()
|
describe('cursor and column position with conceal and tabulators', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('are working', function()
|
it('are working', function()
|
||||||
insert([[
|
insert([[
|
||||||
start:
|
start:
|
||||||
|
@@ -15,6 +15,7 @@ describe('store cursor position in session file in UTF-8', function()
|
|||||||
os.remove('test.out')
|
os.remove('test.out')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
start:
|
start:
|
||||||
|
@@ -17,6 +17,7 @@ describe('store cursor position in session file in Latin-1', function()
|
|||||||
os.remove('test.out')
|
os.remove('test.out')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
start:
|
start:
|
||||||
|
@@ -372,6 +372,7 @@ describe('Visual mode and operator', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it('gv in exclusive select mode after operation', function()
|
it('gv in exclusive select mode after operation', function()
|
||||||
source([[
|
source([[
|
||||||
$put ='zzz '
|
$put ='zzz '
|
||||||
|
@@ -7,6 +7,9 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
|||||||
describe('breakindent', function()
|
describe('breakindent', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
|
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert('dummy text')
|
insert('dummy text')
|
||||||
|
|
||||||
|
@@ -4,6 +4,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
|||||||
local clear, source, expect = helpers.clear, helpers.source, helpers.expect
|
local clear, source, expect = helpers.clear, helpers.source, helpers.expect
|
||||||
local feed_command = helpers.feed_command
|
local feed_command = helpers.feed_command
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
describe('command_count', function()
|
describe('command_count', function()
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
-- It is relevant for the test to load a file initially. If this is
|
-- It is relevant for the test to load a file initially. If this is
|
||||||
|
@@ -6,6 +6,7 @@ local clear, feed, expect = helpers.clear, helpers.feed, helpers.expect
|
|||||||
describe('CTRL-W in Insert mode', function()
|
describe('CTRL-W in Insert mode', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||||
it('works for multi-byte characters', function()
|
it('works for multi-byte characters', function()
|
||||||
|
|
||||||
for i = 1, 6 do
|
for i = 1, 6 do
|
||||||
|
@@ -4,12 +4,14 @@ local helpers = require('test.functional.helpers')(after_each)
|
|||||||
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
|
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
|
||||||
local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect
|
local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
describe("'listchars'", function()
|
describe("'listchars'", function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
feed_command('set listchars&vi')
|
feed_command('set listchars&vi')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it("works with 'list'", function()
|
it("works with 'list'", function()
|
||||||
source([[
|
source([[
|
||||||
function GetScreenCharsForLine(lnum)
|
function GetScreenCharsForLine(lnum)
|
||||||
|
@@ -7,6 +7,9 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
|||||||
describe('listlbr', function()
|
describe('listlbr', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
|
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespaces in a string)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
insert([[
|
insert([[
|
||||||
dummy text]])
|
dummy text]])
|
||||||
@@ -20,20 +23,20 @@ describe('listlbr', function()
|
|||||||
feed_command('set ts=4 sw=4 sts=4 linebreak sbr=+ wrap')
|
feed_command('set ts=4 sw=4 sts=4 linebreak sbr=+ wrap')
|
||||||
source([[
|
source([[
|
||||||
fu! ScreenChar(width)
|
fu! ScreenChar(width)
|
||||||
let c=''
|
let c=''
|
||||||
for j in range(1,4)
|
for j in range(1,4)
|
||||||
for i in range(1,a:width)
|
for i in range(1,a:width)
|
||||||
let c.=nr2char(screenchar(j, i))
|
let c.=nr2char(screenchar(j, i))
|
||||||
endfor
|
endfor
|
||||||
let c.="\n"
|
let c.="\n"
|
||||||
endfor
|
endfor
|
||||||
return c
|
return c
|
||||||
endfu
|
endfu
|
||||||
fu! DoRecordScreen()
|
fu! DoRecordScreen()
|
||||||
wincmd l
|
wincmd l
|
||||||
$put =printf(\"\n%s\", g:test)
|
$put =printf(\"\n%s\", g:test)
|
||||||
$put =g:line
|
$put =g:line
|
||||||
wincmd p
|
wincmd p
|
||||||
endfu
|
endfu
|
||||||
]])
|
]])
|
||||||
feed_command('let g:test="Test 1: set linebreak"')
|
feed_command('let g:test="Test 1: set linebreak"')
|
||||||
|
@@ -8,6 +8,8 @@ local clear, expect = helpers.clear, helpers.expect
|
|||||||
describe('linebreak', function()
|
describe('linebreak', function()
|
||||||
setup(clear)
|
setup(clear)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespaces in a string)
|
||||||
it('is working', function()
|
it('is working', function()
|
||||||
source([[
|
source([[
|
||||||
set wildchar=^E
|
set wildchar=^E
|
||||||
@@ -18,20 +20,20 @@ describe('linebreak', function()
|
|||||||
norm! zt
|
norm! zt
|
||||||
set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
|
set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
|
||||||
fu! ScreenChar(width, lines)
|
fu! ScreenChar(width, lines)
|
||||||
let c=''
|
let c=''
|
||||||
for j in range(1,a:lines)
|
for j in range(1,a:lines)
|
||||||
for i in range(1,a:width)
|
for i in range(1,a:width)
|
||||||
let c.=nr2char(screenchar(j, i))
|
let c.=nr2char(screenchar(j, i))
|
||||||
endfor
|
endfor
|
||||||
let c.="\n"
|
let c.="\n"
|
||||||
endfor
|
endfor
|
||||||
return c
|
return c
|
||||||
endfu
|
endfu
|
||||||
fu! DoRecordScreen()
|
fu! DoRecordScreen()
|
||||||
wincmd l
|
wincmd l
|
||||||
$put =printf(\"\n%s\", g:test)
|
$put =printf(\"\n%s\", g:test)
|
||||||
$put =g:line
|
$put =g:line
|
||||||
wincmd p
|
wincmd p
|
||||||
endfu
|
endfu
|
||||||
"
|
"
|
||||||
let g:test ="Test 1: set linebreak + set list + fancy listchars"
|
let g:test ="Test 1: set linebreak + set list + fancy listchars"
|
||||||
|
@@ -7,6 +7,7 @@ describe('marks', function()
|
|||||||
clear()
|
clear()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 621 (Indentation)
|
||||||
it('restores a deleted mark after delete-undo-redo-undo', function()
|
it('restores a deleted mark after delete-undo-redo-undo', function()
|
||||||
insert([[
|
insert([[
|
||||||
|
|
||||||
|
@@ -54,6 +54,7 @@ describe('utf8', function()
|
|||||||
eq(1, eval('strchars("\\u20dd", 1)'))
|
eq(1, eval('strchars("\\u20dd", 1)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it('customlist completion', function()
|
it('customlist completion', function()
|
||||||
source([[
|
source([[
|
||||||
function! CustomComplete1(lead, line, pos)
|
function! CustomComplete1(lead, line, pos)
|
||||||
|
Reference in New Issue
Block a user