diff options
51 files changed, 651 insertions, 191 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 47e23b6e80..3130747e08 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -8810,11 +8810,12 @@ makeopens ( && buf->b_fname != NULL && buf->b_p_bl) { if (fprintf(fd, "badd +%" PRId64 " ", - buf->b_wininfo == NULL ? - (int64_t)1L : - (int64_t)buf->b_wininfo->wi_fpos.lnum) < 0 - || ses_fname(fd, buf, &ssop_flags) == FAIL) + buf->b_wininfo == NULL + ? (int64_t)1L + : (int64_t)buf->b_wininfo->wi_fpos.lnum) < 0 + || ses_fname(fd, buf, &ssop_flags, true) == FAIL) { return FAIL; + } } } @@ -8885,11 +8886,13 @@ makeopens ( && !bt_nofile(wp->w_buffer) ) { 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; - need_tabnew = FALSE; - if (!wp->w_arg_idx_invalid) + } + need_tabnew = false; + if (!wp->w_arg_idx_invalid) { edited_win = wp; + } break; } } @@ -8933,6 +8936,8 @@ makeopens ( // resized when moving between windows. // Do this before restoring the view, so that the topline and the // 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") == FAIL) { return FAIL; @@ -9221,24 +9226,35 @@ put_view ( if (wp->w_buffer->b_ffname != NULL && (!bt_nofile(wp->w_buffer) || wp->w_buffer->terminal) ) { - /* - * Editing a file in this buffer: use ":edit file". - * This may have side effects! (e.g., compressed or network file). - */ - if (fputs("edit ", fd) < 0 - || ses_fname(fd, wp->w_buffer, flagp) == FAIL) + // Editing a file in this buffer: use ":edit file". + // This may have side effects! (e.g., compressed or network file). + // + // Note, if a buffer for that file already exists, use :badd to + // edit that buffer, to not lose folding information (:edit resets + // 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; + } } else { - /* No file in this buffer, just make it empty. */ - if (put_line(fd, "enew") == FAIL) + // 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. */ + // 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) + || ses_fname(fd, wp->w_buffer, flagp, true) == FAIL) { return FAIL; + } } - do_cursor = FALSE; + do_cursor = false; } } @@ -9389,12 +9405,10 @@ ses_arglist ( return OK; } -/* - * Write a buffer name to the session file. - * Also ends the line. - * Returns FAIL if writing fails. - */ -static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp) +/// Write a buffer name to the session file. +/// Also ends the line, if "add_eol" is true. +/// Returns FAIL if writing fails. +static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp, bool add_eol) { char_u *name; @@ -9411,8 +9425,10 @@ static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp) name = buf->b_sfname; else 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 OK; } diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 2ee72cdb6a..300e506854 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -1146,8 +1146,9 @@ EXTERN char_u e_winheight[] INIT(= N_( EXTERN char_u e_winwidth[] INIT(= N_( "E592: 'winwidth' cannot be smaller than 'winminwidth'")); EXTERN char_u e_write[] INIT(= N_("E80: Error while writing")); -EXTERN char_u e_zerocount[] INIT(= N_("Zero count")); -EXTERN char_u e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context")); +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_intern2[] INIT(= N_("E685: Internal error: %s")); EXTERN char_u e_maxmempat[] INIT(= N_( "E363: pattern uses more memory than 'maxmempattern'")); diff --git a/src/nvim/option.c b/src/nvim/option.c index 74250e83e6..13aadb71bb 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2997,9 +2997,10 @@ did_set_string_option ( if (s[-1] == 'k' || s[-1] == 's') { /* skip optional filename after 'k' and 's' */ while (*s && *s != ',' && *s != ' ') { - if (*s == '\\') - ++s; - ++s; + if (*s == '\\' && s[1] != NUL) { + s++; + } + s++; } } else { if (errbuf != NULL) { diff --git a/src/nvim/search.c b/src/nvim/search.c index 1bf2317d2a..387614fd09 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -3557,11 +3557,15 @@ extend: --start_lnum; if (VIsual_active) { - /* Problem: when doing "Vipipip" nothing happens in a single white - * line, we get stuck there. Trap this here. */ - if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum) + // Problem: when doing "Vipipip" nothing happens in a single white + // line, we get stuck there. Trap this here. + if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum) { goto extend; - VIsual.lnum = start_lnum; + } + if (VIsual.lnum != start_lnum) { + VIsual.lnum = start_lnum; + VIsual.col = 0; + } VIsual_mode = 'V'; redraw_curbuf_later(INVERTED); /* update the inversion */ showmode(); diff --git a/src/nvim/testdir/test_help_tagjump.vim b/src/nvim/testdir/test_help_tagjump.vim index 1ca0f722cf..65d99c644c 100644 --- a/src/nvim/testdir/test_help_tagjump.vim +++ b/src/nvim/testdir/test_help_tagjump.vim @@ -89,17 +89,8 @@ func s:doc_config_teardown() endif endfunc -func s:get_cmd_compl_list(cmd) - let list = [] - 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 +func s:get_help_compl_list(cmd) + return getcompletion(a:cmd, 'help') endfunc func Test_help_complete() @@ -111,49 +102,49 @@ func Test_help_complete() if has('multi_lang') set helplang= endif - let list = s:get_cmd_compl_list(":h test") - call assert_equal(['h test-col', 'h test-char'], list) + let list = s:get_help_compl_list("test") + call assert_equal(['test-col', 'test-char'], list) if has('multi_lang') " 'helplang=ab' and help file lang is 'en' set helplang=ab - let list = s:get_cmd_compl_list(":h test") - call assert_equal(['h test-col', 'h test-char'], list) + let list = s:get_help_compl_list("test") + call assert_equal(['test-col', 'test-char'], list) " 'helplang=' and help file lang is 'en' and 'ab' set rtp+=Xdir1/doc-ab set helplang= - let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col@en', 'h test-col@ab', - \ 'h test-char@en', 'h test-char@ab']), sort(list)) + let list = s:get_help_compl_list("test") + call assert_equal(sort(['test-col@en', 'test-col@ab', + \ 'test-char@en', 'test-char@ab']), sort(list)) " 'helplang=ab' and help file lang is 'en' and 'ab' set helplang=ab - let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col', 'h test-col@en', - \ 'h test-char', 'h test-char@en']), sort(list)) + let list = s:get_help_compl_list("test") + call assert_equal(sort(['test-col', 'test-col@en', + \ 'test-char', 'test-char@en']), sort(list)) " 'helplang=' and help file lang is 'en', 'ab' and 'ja' set rtp+=Xdir1/doc-ja set helplang= - let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col@en', 'h test-col@ab', - \ 'h test-col@ja', 'h test-char@en', - \ 'h test-char@ab', 'h test-char@ja']), sort(list)) + let list = s:get_help_compl_list("test") + call assert_equal(sort(['test-col@en', 'test-col@ab', + \ 'test-col@ja', 'test-char@en', + \ 'test-char@ab', 'test-char@ja']), sort(list)) " 'helplang=ab' and help file lang is 'en', 'ab' and 'ja' set helplang=ab - let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col', 'h test-col@en', - \ 'h test-col@ja', 'h test-char', - \ 'h test-char@en', 'h test-char@ja']), sort(list)) + let list = s:get_help_compl_list("test") + call assert_equal(sort(['test-col', 'test-col@en', + \ 'test-col@ja', 'test-char', + \ 'test-char@en', 'test-char@ja']), sort(list)) " 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja' set helplang=ab,ja - let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col', 'h test-col@ja', - \ 'h test-col@en', 'h test-char', - \ 'h test-char@ja', 'h test-char@en']), sort(list)) + let list = s:get_help_compl_list("test") + call assert_equal(sort(['test-col', 'test-col@ja', + \ 'test-col@en', 'test-char', + \ 'test-char@ja', 'test-char@en']), sort(list)) endif catch call assert_exception('X') diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index 2238213850..4774cf4af5 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -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 multibyteCharacter', + \ 'a two multiByte characters', + \ 'A 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. func Test_mksession_arglist() @@ -12,4 +121,35 @@ func Test_mksession_arglist() argdel * 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 diff --git a/src/nvim/testdir/test_mksession_utf8.vim b/src/nvim/testdir/test_mksession_utf8.vim new file mode 100644 index 0000000000..c05a1d3b6d --- /dev/null +++ b/src/nvim/testdir/test_mksession_utf8.vim @@ -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 diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index 2ffe63787b..8a9d793a2e 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -103,3 +103,13 @@ func Test_keymap_valid() call assert_fails(":set kmp=trunc\x00name", "E544:") call assert_fails(":set kmp=trunc\x00name", "trunc") 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 + diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index 74c26e3d66..8cb59ca32a 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -28,3 +28,10 @@ func Test_Visual_ctrl_o() set tw& bw! endfu + +func Test_Visual_vapo() + new + normal oxx + normal vapo + bwipe! +endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index d4f9c0232f..b0d4e194fa 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -77,6 +77,157 @@ static char *features[] = { // clang-format off 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, // 874, // 873, @@ -619,12 +770,12 @@ static const int included_patches[] = { // 336, // 335, // 334, - // 333, + 333, // 332, 331, - // 330, + 330, // 329, - // 328, + 328, 327, 326, 325, @@ -694,12 +845,12 @@ static const int included_patches[] = { // 261, // 260 NA 259, - // 258, + 258, // 257 NA // 256, // 255, // 254, - // 253, + 253, // 252, // 251, 250, @@ -840,7 +991,7 @@ static const int included_patches[] = { // 115 NA // 114 NA // 113 NA - // 112, + 112, 111, 110, // 109 NA @@ -861,7 +1012,7 @@ static const int included_patches[] = { // 94 NA // 93 NA 92, - // 91, + 91, 90, // 89 NA 88, diff --git a/test/.luacheckrc b/test/.luacheckrc index 034b4f10df..abfa881754 100644 --- a/test/.luacheckrc +++ b/test/.luacheckrc @@ -17,4 +17,4 @@ ignore = { } -- Ignore whitespace issues in converted Vim legacy tests. -files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }} +--files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }} diff --git a/test/functional/legacy/003_cindent_spec.lua b/test/functional/legacy/003_cindent_spec.lua index 0cc4d298b7..202baadd4c 100644 --- a/test/functional/legacy/003_cindent_spec.lua +++ b/test/functional/legacy/003_cindent_spec.lua @@ -15,6 +15,8 @@ local function insert_(content) feed_command('1', 'set cin ts=4 sw=4') end +-- luacheck: ignore 621 (Indentation) +-- luacheck: ignore 613 (Trailing whitespace in a string) describe('cindent', function() before_each(clear) diff --git a/test/functional/legacy/005_bufleave_delete_buffer_spec.lua b/test/functional/legacy/005_bufleave_delete_buffer_spec.lua index 417842c52d..8b92c877a6 100644 --- a/test/functional/legacy/005_bufleave_delete_buffer_spec.lua +++ b/test/functional/legacy/005_bufleave_delete_buffer_spec.lua @@ -9,6 +9,7 @@ local wait = helpers.wait describe('test5', function() setup(clear) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ start of test file Xxx diff --git a/test/functional/legacy/006_argument_list_spec.lua b/test/functional/legacy/006_argument_list_spec.lua index dac58df8a5..9f75a91fa8 100644 --- a/test/functional/legacy/006_argument_list_spec.lua +++ b/test/functional/legacy/006_argument_list_spec.lua @@ -78,8 +78,8 @@ describe('argument list', function() end) teardown(function() - os.remove('Xxx1') - os.remove('Xxx2') - os.remove('Xxx3') + os.remove('Xxx1') + os.remove('Xxx2') + os.remove('Xxx3') end) end) diff --git a/test/functional/legacy/007_ball_buffer_list_spec.lua b/test/functional/legacy/007_ball_buffer_list_spec.lua index 8501faabec..a180e73301 100644 --- a/test/functional/legacy/007_ball_buffer_list_spec.lua +++ b/test/functional/legacy/007_ball_buffer_list_spec.lua @@ -36,10 +36,10 @@ describe(':ball', function() -- Open window for all args, close Xxx2 feed('$r4:ball<cr>') - + -- Write contents of this file feed_command('%yank A') - + -- Append contents of second window (Xxx1) feed('') feed_command('%yank A') diff --git a/test/functional/legacy/011_autocommands_spec.lua b/test/functional/legacy/011_autocommands_spec.lua index e01af4583b..d969a8bd37 100644 --- a/test/functional/legacy/011_autocommands_spec.lua +++ b/test/functional/legacy/011_autocommands_spec.lua @@ -94,6 +94,8 @@ describe('file reading, writing and bufnew and filter autocommands', function() eq(gzip_data, io.open('Xtestfile.gz'):read('*all')) end) + -- luacheck: ignore 621 (Indentation) + -- luacheck: ignore 611 (Line contains only whitespaces) it('FileReadPre, FileReadPost', function() prepare_gz_file('Xtestfile', text1) feed_command('au! FileReadPre *.gz exe "silent !gzip -d " . shellescape(expand("<afile>"))') diff --git a/test/functional/legacy/015_alignment_spec.lua b/test/functional/legacy/015_alignment_spec.lua index 8423aa3d11..d73ff06972 100644 --- a/test/functional/legacy/015_alignment_spec.lua +++ b/test/functional/legacy/015_alignment_spec.lua @@ -9,6 +9,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers describe('alignment', function() setup(clear) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ test for :left @@ -112,7 +113,7 @@ describe('alignment', function() asxa;ofa axxxoikey asdfaqwer axxxoikey - xxxxx xx xxxxxx + xxxxx xx xxxxxx xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx xx xxxxxxx. xxxx xxxx. diff --git a/test/functional/legacy/019_smarttab_expandtab_spec.lua b/test/functional/legacy/019_smarttab_expandtab_spec.lua index ecb24885bb..7b03ee8e99 100644 --- a/test/functional/legacy/019_smarttab_expandtab_spec.lua +++ b/test/functional/legacy/019_smarttab_expandtab_spec.lua @@ -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() setup(clear) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ start text diff --git a/test/functional/legacy/029_join_spec.lua b/test/functional/legacy/029_join_spec.lua index 460b9291bf..b28f276a7c 100644 --- a/test/functional/legacy/029_join_spec.lua +++ b/test/functional/legacy/029_join_spec.lua @@ -11,6 +11,8 @@ local feed_command = helpers.feed_command describe('joining lines', function() 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() insert([[ firstline diff --git a/test/functional/legacy/033_lisp_indent_spec.lua b/test/functional/legacy/033_lisp_indent_spec.lua index 2b79ee024b..5132333a5c 100644 --- a/test/functional/legacy/033_lisp_indent_spec.lua +++ b/test/functional/legacy/033_lisp_indent_spec.lua @@ -9,6 +9,7 @@ local wait = helpers.wait describe('lisp indent', function() setup(clear) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ (defun html-file (base) @@ -22,7 +23,7 @@ describe('lisp indent', function() :if-exists :supersede) (let ((,ti ,title)) (as title ,ti) - (with center + (with center (as h2 (string-upcase ,ti))) (brs 3) ,@body)))) @@ -58,7 +59,7 @@ describe('lisp indent', function() :if-exists :supersede) (let ((,ti ,title)) (as title ,ti) - (with center + (with center (as h2 (string-upcase ,ti))) (brs 3) ,@body)))) diff --git a/test/functional/legacy/038_virtual_replace_spec.lua b/test/functional/legacy/038_virtual_replace_spec.lua index 2dfc959a8c..8dd7bdda6e 100644 --- a/test/functional/legacy/038_virtual_replace_spec.lua +++ b/test/functional/legacy/038_virtual_replace_spec.lua @@ -7,6 +7,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers describe('Virtual replace mode', function() setup(clear) + -- luacheck: ignore 621 (Indentation) it('is working', function() -- Make sure that backspace works, no matter what termcap is used. feed_command('set t_kD=x7f t_kb=x08') diff --git a/test/functional/legacy/039_visual_block_mode_commands_spec.lua b/test/functional/legacy/039_visual_block_mode_commands_spec.lua index dffef50950..135058c579 100644 --- a/test/functional/legacy/039_visual_block_mode_commands_spec.lua +++ b/test/functional/legacy/039_visual_block_mode_commands_spec.lua @@ -43,6 +43,7 @@ describe('Visual block mode', function() abcdqqqqijklm]]) end) + -- luacheck: ignore 611 (Line contains only whitespaces) it('should insert a block using cursor keys for movement', function() insert([[ aaaaaa @@ -104,6 +105,7 @@ describe('Visual block mode', function() 456ab7]]) end) + -- luacheck: ignore 621 (Indentation) it('should insert and append a block when virtualedit=all', function() insert([[ line1 diff --git a/test/functional/legacy/055_list_and_dict_types_spec.lua b/test/functional/legacy/055_list_and_dict_types_spec.lua index e84c415eb0..dcbd8b7dff 100644 --- a/test/functional/legacy/055_list_and_dict_types_spec.lua +++ b/test/functional/legacy/055_list_and_dict_types_spec.lua @@ -191,6 +191,7 @@ describe('list and dictionary types', function() [3]]=]) end) + -- luacheck: ignore 613 (Trailing whitespace in a string) it('assignment to a list', function() source([[ let l = [0, 1, 2, 3] diff --git a/test/functional/legacy/060_exists_and_has_functions_spec.lua b/test/functional/legacy/060_exists_and_has_functions_spec.lua index 3e99f6df57..1794f23b3a 100644 --- a/test/functional/legacy/060_exists_and_has_functions_spec.lua +++ b/test/functional/legacy/060_exists_and_has_functions_spec.lua @@ -12,7 +12,7 @@ describe('exists() and has() functions', function() write_file('test60.vim', [[ " Vim script for exists() function test " Script-local variables are checked here - + " Existing script-local variable let s:script_var = 1 echo 's:script_var: 1' @@ -21,7 +21,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Non-existing script-local variable unlet s:script_var echo 's:script_var: 0' @@ -30,7 +30,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Existing script-local list let s:script_list = ["blue", "orange"] echo 's:script_list: 1' @@ -39,7 +39,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Non-existing script-local list unlet s:script_list echo 's:script_list: 0' @@ -48,7 +48,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Existing script-local dictionary let s:script_dict = {"xcord":100, "ycord":2} echo 's:script_dict: 1' @@ -57,7 +57,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Non-existing script-local dictionary unlet s:script_dict echo 's:script_dict: 0' @@ -66,7 +66,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Existing script curly-brace variable let str = "script" let s:curly_{str}_var = 1 @@ -76,7 +76,7 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Non-existing script-local curly-brace variable unlet s:curly_{str}_var echo 's:curly_' . str . '_var: 0' @@ -85,21 +85,21 @@ describe('exists() and has() functions', function() else echo "FAILED" endif - + " Existing script-local function function! s:my_script_func() endfunction - + echo '*s:my_script_func: 1' if exists('*s:my_script_func') echo "OK" else echo "FAILED" endif - + " Non-existing script-local function delfunction s:my_script_func - + echo '*s:my_script_func: 0' if !exists('*s:my_script_func') echo "OK" @@ -644,7 +644,7 @@ describe('exists() and has() functions', function() -- Assert buffer contents. expect([[ - + #myagroup: 1 OK #myagroup+b: 0 diff --git a/test/functional/legacy/066_visual_block_tab_spec.lua b/test/functional/legacy/066_visual_block_tab_spec.lua index 7c4984362f..f10152d8ea 100644 --- a/test/functional/legacy/066_visual_block_tab_spec.lua +++ b/test/functional/legacy/066_visual_block_tab_spec.lua @@ -15,7 +15,7 @@ describe('visual block shift and tab characters', function() one two three one two three one two three - + abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz @@ -49,7 +49,7 @@ describe('visual block shift and tab characters', function() on1 two three on1 two three on1 two three - + abcdefghijklmnopqrstuvwxyz abcdefghij abc defghijklmnopqrstuvwxyz diff --git a/test/functional/legacy/068_text_formatting_spec.lua b/test/functional/legacy/068_text_formatting_spec.lua index 772dbc14cf..3a1b21bf87 100644 --- a/test/functional/legacy/068_text_formatting_spec.lua +++ b/test/functional/legacy/068_text_formatting_spec.lua @@ -9,6 +9,7 @@ local expect = helpers.expect describe('text formatting', function() setup(clear) + -- luacheck: ignore 613 (Trailing whitespace in a string) it('is working', function() -- 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 diff --git a/test/functional/legacy/069_multibyte_formatting_spec.lua b/test/functional/legacy/069_multibyte_formatting_spec.lua index 38ca25d57a..9c248e3aa8 100644 --- a/test/functional/legacy/069_multibyte_formatting_spec.lua +++ b/test/functional/legacy/069_multibyte_formatting_spec.lua @@ -27,7 +27,7 @@ describe('multibyte text', function() XYZ abc XYZ - + XYZ abc XYZ @@ -62,7 +62,7 @@ describe('multibyte text', function() Y X Y - + X X a @@ -125,7 +125,7 @@ describe('multibyte text', function() ab X Y - + X X a @@ -166,7 +166,7 @@ describe('multibyte text', function() X X a - + X X a @@ -190,7 +190,7 @@ describe('multibyte text', function() X X a - + X X a @@ -239,7 +239,7 @@ describe('multibyte text', function() XX XXa XXY - + X Xa Xa @@ -259,7 +259,7 @@ describe('multibyte text', function() it('formatting in replace mode', function() insert([[ { - + }]]) feed_command('/^{/+1') feed_command('set tw=2 fo=tm') diff --git a/test/functional/legacy/078_swapfile_recover_spec.lua b/test/functional/legacy/078_swapfile_recover_spec.lua index 4390ba2ca8..45f0aed37a 100644 --- a/test/functional/legacy/078_swapfile_recover_spec.lua +++ b/test/functional/legacy/078_swapfile_recover_spec.lua @@ -22,32 +22,32 @@ describe('78', function() let linecount = 10000 while i <= linecount | call append(i - 1, i . text) | let i += 1 | endwhile preserve - + " Get the name of the swap file, and clean up the :redir capture. redir => g:swapname | swapname | redir END let g:swapname = substitute(g:swapname, '[[:blank:][:cntrl:]]*\(.\{-}\)[[:blank:][:cntrl:]]*$', '\1', 'g') let g:swapname = fnameescape(g:swapname) - + " Make a copy of the swap file in Xswap set bin exe 'sp ' . g:swapname w! Xswap - + set nobin new only! bwipe! Xtest call rename('Xswap', g:swapname) - + "TODO(jkeyes): without 'silent', this hangs the test " at message: " 'Recovery completed. You should check if everything is OK.' silent recover Xtest - + call delete(g:swapname) new call append(0, 'recovery start') wincmd w - + let g:linedollar = line('$') if g:linedollar < linecount wincmd w @@ -56,7 +56,7 @@ describe('78', function() wincmd w let linecount = g:linedollar endif - + let i = 1 while i <= linecount if getline(i) != i . text @@ -72,7 +72,7 @@ describe('78', function() expect([[ recovery start - + recovery end]]) end) end) diff --git a/test/functional/legacy/081_coptions_movement_spec.lua b/test/functional/legacy/081_coptions_movement_spec.lua index 993aff2ba2..d82c46a3d3 100644 --- a/test/functional/legacy/081_coptions_movement_spec.lua +++ b/test/functional/legacy/081_coptions_movement_spec.lua @@ -7,6 +7,7 @@ local feed_command, expect = helpers.feed_command, helpers.expect describe('coptions', function() setup(clear) + -- luacheck: ignore 613 (Trailing whitespace in a string) it('is working', function() insert([[ aaa two three four diff --git a/test/functional/legacy/082_string_comparison_spec.lua b/test/functional/legacy/082_string_comparison_spec.lua index cfc0b96bce..311822c34f 100644 --- a/test/functional/legacy/082_string_comparison_spec.lua +++ b/test/functional/legacy/082_string_comparison_spec.lua @@ -115,9 +115,9 @@ describe('case-insensitive string comparison in UTF-8', function() -- Assert buffer contents. expect([=[ 3732 checks passed - + ABCD - + defg]=]) end) end) diff --git a/test/functional/legacy/084_curswant_spec.lua b/test/functional/legacy/084_curswant_spec.lua index 9809ce5b88..42cb2fc56d 100644 --- a/test/functional/legacy/084_curswant_spec.lua +++ b/test/functional/legacy/084_curswant_spec.lua @@ -7,6 +7,7 @@ local clear, expect = helpers.clear, helpers.expect describe('curswant', function() setup(clear) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ start target options diff --git a/test/functional/legacy/088_conceal_tabs_spec.lua b/test/functional/legacy/088_conceal_tabs_spec.lua index c9414679ab..a4c7e26583 100644 --- a/test/functional/legacy/088_conceal_tabs_spec.lua +++ b/test/functional/legacy/088_conceal_tabs_spec.lua @@ -12,6 +12,7 @@ end describe('cursor and column position with conceal and tabulators', function() setup(clear) + -- luacheck: ignore 621 (Indentation) it('are working', function() insert([[ start: diff --git a/test/functional/legacy/089_number_relnumber_findfile_spec.lua b/test/functional/legacy/089_number_relnumber_findfile_spec.lua index 7a87fc8603..6708fd50b7 100644 --- a/test/functional/legacy/089_number_relnumber_findfile_spec.lua +++ b/test/functional/legacy/089_number_relnumber_findfile_spec.lua @@ -63,26 +63,26 @@ describe("setting 'number' and 'relativenumber'", function() -- Assert buffer contents. expect([[ results: - + number relativenumber - + number relativenumber :setlocal must NOT reset the other global value - + number - + relativenumber :setglobal MUST reset the other global value - + number - + relativenumber :set MUST reset the other global value - + number - + relativenumber]]) end) end) @@ -108,7 +108,7 @@ describe('findfile', function() expect([[ Testing findfile - + src/nvim/api/vim.c api/vim.c api/vim.c]]) diff --git a/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua b/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua index 44f1664abe..3c46c29951 100644 --- a/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua +++ b/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua @@ -15,6 +15,7 @@ describe('store cursor position in session file in UTF-8', function() os.remove('test.out') end) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ start: diff --git a/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua b/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua index 49bc43f76f..b1221ff8b6 100644 --- a/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua +++ b/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua @@ -17,6 +17,7 @@ describe('store cursor position in session file in Latin-1', function() os.remove('test.out') end) + -- luacheck: ignore 621 (Indentation) it('is working', function() insert([[ start: diff --git a/test/functional/legacy/094_visual_mode_operators_spec.lua b/test/functional/legacy/094_visual_mode_operators_spec.lua index 84e384050a..ff1d3e7bec 100644 --- a/test/functional/legacy/094_visual_mode_operators_spec.lua +++ b/test/functional/legacy/094_visual_mode_operators_spec.lua @@ -372,6 +372,7 @@ describe('Visual mode and operator', function() end) end) + -- luacheck: ignore 613 (Trailing whitespace in a string) it('gv in exclusive select mode after operation', function() source([[ $put ='zzz ' diff --git a/test/functional/legacy/103_visual_mode_reset_spec.lua b/test/functional/legacy/103_visual_mode_reset_spec.lua index d05b47fa32..f5cd861019 100644 --- a/test/functional/legacy/103_visual_mode_reset_spec.lua +++ b/test/functional/legacy/103_visual_mode_reset_spec.lua @@ -32,7 +32,7 @@ describe('E315 error', function() -- :del the ex-way will require the colon operator which resets the -- visual mode thus preventing the problem: feed('GV:call TriggerTheProblem()<cr>') - + source([[ %del _ call append(line('$'), g:msg) @@ -41,7 +41,7 @@ describe('E315 error', function() -- Assert buffer contents. expect([[ - + Everything's fine.]]) end) end) diff --git a/test/functional/legacy/106_errorformat_spec.lua b/test/functional/legacy/106_errorformat_spec.lua index 5d76adc786..3f017a704f 100644 --- a/test/functional/legacy/106_errorformat_spec.lua +++ b/test/functional/legacy/106_errorformat_spec.lua @@ -15,9 +15,9 @@ describe('errorformat', function() command("$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))") command("cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY']") command("$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))") - + expect([=[ - + [['W', 1], ['E^@CCCC', 1]] [['W', 1], ['E^@CCCC', 1]] [['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]]=]) diff --git a/test/functional/legacy/108_backtrace_debug_commands_spec.lua b/test/functional/legacy/108_backtrace_debug_commands_spec.lua index b2e2fa4ed3..ff1917e90c 100644 --- a/test/functional/legacy/108_backtrace_debug_commands_spec.lua +++ b/test/functional/legacy/108_backtrace_debug_commands_spec.lua @@ -89,18 +89,18 @@ describe('108', function() -- Assert buffer contents. expect([=[ - - - + + + - show backtrace: - + 2 function Foo[2] 1 Bar[2] ->0 Bazz line 2: let var3 = "another var" - + show variables on different levels: - + 6 2 function Foo[2] ->1 Bar[2] @@ -112,9 +112,9 @@ describe('108', function() 0 Bazz line 2: let var3 = "another var" 1 - + - undefined vars: - + undefined var3 on former level: Error detected while processing function Foo[2]..Bar[2]..Bazz: line 3: @@ -122,7 +122,7 @@ describe('108', function() E15: Invalid expression: var3 here var3 is defined with "another var": another var - + undefined var2 on former level Error detected while processing function Foo[2]..Bar: line 3: @@ -130,37 +130,37 @@ describe('108', function() E15: Invalid expression: var2 here var2 is defined with 10: 10 - + - backtrace movements: - + 1 function Foo[2] ->0 Bar line 3: End of function - + next command cannot go down, we are on bottom - + frame is zero - + next command cannot go up, we are on top - + frame at highest level: 1 ->1 function Foo[2] 0 Bar line 3: End of function fil is not frame or finish, it is file "[No Name]" --No lines in buffer-- - + - relative backtrace movement - + 1 function Foo[2] ->0 Bar line 3: End of function ->1 function Foo[2] 0 Bar line 3: End of function - + - go beyond limits does not crash - + frame at highest level: 1 ->1 function Foo[2] 0 Bar @@ -169,7 +169,7 @@ describe('108', function() 1 function Foo[2] ->0 Bar line 3: End of function - + - final result 19: 19 ]=]) diff --git a/test/functional/legacy/breakindent_spec.lua b/test/functional/legacy/breakindent_spec.lua index 7594dba16c..fd25e809e0 100644 --- a/test/functional/legacy/breakindent_spec.lua +++ b/test/functional/legacy/breakindent_spec.lua @@ -7,6 +7,9 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers describe('breakindent', function() 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() insert('dummy text') diff --git a/test/functional/legacy/command_count_spec.lua b/test/functional/legacy/command_count_spec.lua index ad5368430a..8707c0459c 100644 --- a/test/functional/legacy/command_count_spec.lua +++ b/test/functional/legacy/command_count_spec.lua @@ -4,6 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, source, expect = helpers.clear, helpers.source, helpers.expect local feed_command = helpers.feed_command +-- luacheck: ignore 613 (Trailing whitespace in a string) describe('command_count', function() it('is working', function() -- It is relevant for the test to load a file initially. If this is @@ -133,8 +134,8 @@ describe('command_count', function() let g:lines = [] func BufStatus() call add(g:lines, - \ 'aaa: ' . buflisted(g:buf_aaa) . - \ ' bbb: ' . buflisted(g:buf_bbb) . + \ 'aaa: ' . buflisted(g:buf_aaa) . + \ ' bbb: ' . buflisted(g:buf_bbb) . \ ' ccc: ' . buflisted(g:buf_ccc)) endfunc se nohidden @@ -214,7 +215,7 @@ describe('command_count', function() RangeTabsAll 1 5 RangeLines 2 5 LocalRangeLines 2 5 - + 5argu E16: Invalid range 4argu d 1argu a @@ -225,7 +226,7 @@ describe('command_count', function() $tabe 2 $+tabe E16: Invalid range 0tabm x - + aaa: 1 bbb: 1 ccc: 1 aaa: 1 bbb: 0 ccc: 0 aaa: 0 bbb: 0 ccc: 0 diff --git a/test/functional/legacy/erasebackword_spec.lua b/test/functional/legacy/erasebackword_spec.lua index 33b7704b65..8ca64df328 100644 --- a/test/functional/legacy/erasebackword_spec.lua +++ b/test/functional/legacy/erasebackword_spec.lua @@ -6,6 +6,7 @@ local clear, feed, expect = helpers.clear, helpers.feed, helpers.expect describe('CTRL-W in Insert mode', function() setup(clear) + -- luacheck: ignore 611 (Line contains only whitespaces) it('works for multi-byte characters', function() for i = 1, 6 do diff --git a/test/functional/legacy/increment_spec.lua b/test/functional/legacy/increment_spec.lua index 15273a4ad5..d51f9a2e02 100644 --- a/test/functional/legacy/increment_spec.lua +++ b/test/functional/legacy/increment_spec.lua @@ -685,7 +685,7 @@ describe('Ctrl-A/Ctrl-X on visual selections', function() " Text: " 1 23 " 4 56 - " + " " Expected: " 1) f2 Ctrl-V jl <ctrl-a>, repeat twice afterwards with . " 1 26 diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index 3c0fa48e76..cffb9fd376 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -4,12 +4,14 @@ local helpers = require('test.functional.helpers')(after_each) local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect +-- luacheck: ignore 621 (Indentation) describe("'listchars'", function() before_each(function() clear() feed_command('set listchars&vi') end) + -- luacheck: ignore 613 (Trailing whitespace in a string) it("works with 'list'", function() source([[ function GetScreenCharsForLine(lnum) diff --git a/test/functional/legacy/listlbr_spec.lua b/test/functional/legacy/listlbr_spec.lua index d39125c9e6..f70d55f4a3 100644 --- a/test/functional/legacy/listlbr_spec.lua +++ b/test/functional/legacy/listlbr_spec.lua @@ -7,6 +7,9 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers describe('listlbr', function() 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() insert([[ dummy text]]) @@ -20,20 +23,20 @@ describe('listlbr', function() feed_command('set ts=4 sw=4 sts=4 linebreak sbr=+ wrap') source([[ fu! ScreenChar(width) - let c='' - for j in range(1,4) - for i in range(1,a:width) - let c.=nr2char(screenchar(j, i)) - endfor - let c.="\n" - endfor - return c + let c='' + for j in range(1,4) + for i in range(1,a:width) + let c.=nr2char(screenchar(j, i)) + endfor + let c.="\n" + endfor + return c endfu fu! DoRecordScreen() - wincmd l - $put =printf(\"\n%s\", g:test) - $put =g:line - wincmd p + wincmd l + $put =printf(\"\n%s\", g:test) + $put =g:line + wincmd p endfu ]]) feed_command('let g:test="Test 1: set linebreak"') diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index f06bca72ba..d7f4c71af2 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -8,6 +8,8 @@ local clear, expect = helpers.clear, helpers.expect describe('linebreak', function() setup(clear) + -- luacheck: ignore 621 (Indentation) + -- luacheck: ignore 613 (Trailing whitespaces in a string) it('is working', function() source([[ set wildchar=^E @@ -18,20 +20,20 @@ describe('linebreak', function() norm! zt set ts=4 sw=4 sts=4 linebreak sbr=+ wrap fu! ScreenChar(width, lines) - let c='' - for j in range(1,a:lines) - for i in range(1,a:width) - let c.=nr2char(screenchar(j, i)) - endfor + let c='' + for j in range(1,a:lines) + for i in range(1,a:width) + let c.=nr2char(screenchar(j, i)) + endfor let c.="\n" - endfor - return c + endfor + return c endfu fu! DoRecordScreen() - wincmd l - $put =printf(\"\n%s\", g:test) - $put =g:line - wincmd p + wincmd l + $put =printf(\"\n%s\", g:test) + $put =g:line + wincmd p endfu " let g:test ="Test 1: set linebreak + set list + fancy listchars" @@ -148,22 +150,22 @@ describe('linebreak', function() -- Assert buffer contents. expect([[ - + abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP - + Test 1: set linebreak + set list + fancy listchars ▕———abcdef +hijklmn▕——— +pqrstuvwxyz␣1060ABC +DEFGHIJKLMNOPˑ¶ - + Test 2: set nolinebreak list ▕———abcdef hijklmn▕— +pqrstuvwxyz␣1060ABC +DEFGHIJKLMNOPˑ¶ ¶ *mask = nil; - + Test 3: set linebreak nolist *mask = nil; ~ @@ -177,7 +179,7 @@ describe('linebreak', function() #define MSG_MODE_CONSOLE 2 #define MSG_MODE_FILE_AND_CONSOLE 3 #define MSG_MODE_FILE_THEN_CONSOLE 4 - + Test 4: set linebreak list listchars and concealing #define ABCDE>-->---1 #define >CDEF>-->---1 @@ -187,7 +189,7 @@ describe('linebreak', function() #define >_CONSOLE>---------->---2 #define >_FILE_AND_CONSOLE>---------3 bbeeeeee ; some text - + Test 5: set linebreak list listchars and concealing part2 eeeeee>--->-;>some text Test 6: Screenattributes for comment @@ -196,10 +198,10 @@ describe('linebreak', function() Attribut 0 and 1 and 3 and 5 are different! Test 8: set linebreak with visual block mode and v_b_A and selection=exclusive and multibyte char long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETÃx' at end - + a b c a b c - + Test 9: a multibyte sign and colorcolumn ¶ +a b c¶ diff --git a/test/functional/legacy/marks_spec.lua b/test/functional/legacy/marks_spec.lua index bcec179ca2..470ea49652 100644 --- a/test/functional/legacy/marks_spec.lua +++ b/test/functional/legacy/marks_spec.lua @@ -7,6 +7,7 @@ describe('marks', function() clear() end) + -- luacheck: ignore 621 (Indentation) it('restores a deleted mark after delete-undo-redo-undo', function() insert([[ diff --git a/test/functional/legacy/options_spec.lua b/test/functional/legacy/options_spec.lua index 4f4d4ceaf9..1db7afc7a7 100644 --- a/test/functional/legacy/options_spec.lua +++ b/test/functional/legacy/options_spec.lua @@ -21,7 +21,7 @@ describe('set', function() $put =&path]]) expect([[ - + foo,,bar]]) end) end) diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 7c44353aec..2dfd36142b 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -172,9 +172,9 @@ describe('packadd', function() helptags ALL - let tags1 = readfile(docdir1 . '/tags') + let tags1 = readfile(docdir1 . '/tags') call assert_true(tags1[0] =~ 'look-here') - let tags2 = readfile(docdir2 . '/tags') + let tags2 = readfile(docdir2 . '/tags') call assert_true(tags2[0] =~ 'look-away') endfunc diff --git a/test/functional/legacy/tagcase_spec.lua b/test/functional/legacy/tagcase_spec.lua index ed2876a375..9ca0e0009f 100644 --- a/test/functional/legacy/tagcase_spec.lua +++ b/test/functional/legacy/tagcase_spec.lua @@ -53,11 +53,11 @@ describe("'tagcase' option", function() -- Verify that the correct number of matching tags is found for all values of -- 'ignorecase' and global and local values 'tagcase', in all combinations. insert([[ - + Foo Bar foo - + end text]]) source([[ @@ -70,7 +70,7 @@ describe("'tagcase' option", function() endfor endfor endfor - + 1,/^end text$/d]]) expect([[ diff --git a/test/functional/legacy/utf8_spec.lua b/test/functional/legacy/utf8_spec.lua index 02de6ab735..5b93f25b24 100644 --- a/test/functional/legacy/utf8_spec.lua +++ b/test/functional/legacy/utf8_spec.lua @@ -54,6 +54,7 @@ describe('utf8', function() eq(1, eval('strchars("\\u20dd", 1)')) end) + -- luacheck: ignore 613 (Trailing whitespace in a string) it('customlist completion', function() source([[ function! CustomComplete1(lead, line, pos) |