diff --git a/backport-CVE-2022-0351.patch b/backport-CVE-2022-0351.patch index a9096830b8ed7a9fed026e25661da94c3dc972d9..fdda8ed5ccb5466b5ef2e88e891313b74d9ce653 100644 --- a/backport-CVE-2022-0351.patch +++ b/backport-CVE-2022-0351.patch @@ -71,7 +71,7 @@ index ec566da..32a5411 100644 + +func Test_deep_recursion() + " this was running out of stack -+ call assert_fails("exe 'if ' .. repeat('(', 1002)", 'E1169: Expression too recursive: ((')+endfunc ++ call assert_fails("exe 'if ' .. repeat('(', 1002)", 'E1169: Expression too recursive: ((') +endfunc -- 1.8.3.1 diff --git a/backport-CVE-2022-0392.patch b/backport-CVE-2022-0392.patch index b4f2c3ba2467906ba1de67fdb2ebc61a873ea22f..cfc9e0d60519758ca00235bd1e381c3df7fa1286 100644 --- a/backport-CVE-2022-0392.patch +++ b/backport-CVE-2022-0392.patch @@ -9,8 +9,7 @@ Solution: Reserve space for the trailing NUL. --- src/edit.c | 3 ++- - src/testdir/test_paste.vim | 11 +++++++++++ - 2 files changed, 13 insertions(+), 1 deletion(-) + 1 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/edit.c b/src/edit.c index c67f67c..3767769 100644 @@ -26,25 +25,6 @@ index c67f67c..3767769 100644 { mch_memmove((char *)gap->ga_data + gap->ga_len, buf, (size_t)idx); -diff --git a/src/testdir/test_paste.vim b/src/testdir/test_paste.vim -index c30140f..263f084 100644 ---- a/src/testdir/test_paste.vim -+++ b/src/testdir/test_paste.vim -@@ -134,3 +134,14 @@ func Test_xrestore() - - bwipe! - endfunc -+ -+" bracketed paste in Ex-mode -+func Test_paste_ex_mode() -+ unlet! foo -+ call feedkeys("Qlet foo=\"\[200~foo\bar\[201~\"\vi\", 'xt') -+ call assert_equal("foo\rbar", foo) -+ -+ -+ " pasting more than 40 bytes -+ exe "norm Q\0000000000000000000000000000000000000000000000000000000000000000000000\" -+endfunc -- 2.27.0 diff --git a/backport-CVE-2022-1898.patch b/backport-CVE-2022-1898.patch index 0390605e26177c5194a9050039b2bbf56b3e5449..dd66cfac6de7972489ed57c13e38ef6b12a55d17 100644 --- a/backport-CVE-2022-1898.patch +++ b/backport-CVE-2022-1898.patch @@ -45,10 +45,10 @@ index 24df68f..c682682 100644 bwipe! + + new somefile -++ call setline(1, ['first line', '', '#define something 0']) -++ sil norm 0o0 -++ sil! norm ]d -++ bwipe! ++ call setline(1, ['first line', '', '#define something 0']) ++ sil norm 0o0 ++ sil! norm ]d ++ bwipe! endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/backport-CVE-2022-1968.patch b/backport-CVE-2022-1968.patch index aca84cc847972ba5fd78191d07b5537cc1dfeafe..1e0e289987d89ada0176f27ba65ba90915311ac1 100644 --- a/backport-CVE-2022-1968.patch +++ b/backport-CVE-2022-1968.patch @@ -69,7 +69,7 @@ index c682682..18a7f9b 100644 --- a/src/testdir/test_tagjump.vim +++ b/src/testdir/test_tagjump.vim @@ -571,4 +571,15 @@ func Test_define_search() - + bwipe! + bwipe! endfunc +" this was using a line from ml_get() freed by the regexp diff --git a/backport-patch-8.2.0243-insufficient-code-coverage-for-ex_doc.patch b/backport-patch-8.2.0243-insufficient-code-coverage-for-ex_doc.patch new file mode 100644 index 0000000000000000000000000000000000000000..95df1c7e099f7ef2b16702758d9ea1e621c4b159 --- /dev/null +++ b/backport-patch-8.2.0243-insufficient-code-coverage-for-ex_doc.patch @@ -0,0 +1,411 @@ +From 9f6277bdde97b7767ded43a0b5a2023eb601b3b7 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Tue, 11 Feb 2020 22:04:02 +0100 +Subject: [PATCH] patch 8.2.0243: insufficient code coverage for ex_docmd.c + functions + +Problem: Insufficient code coverage for ex_docmd.c functions. +Solution: Add more tests. (Yegappan Lakshmanan, closes #5618) +--- + src/testdir/test_arglist.vim | 17 +++++++ + src/testdir/test_cd.vim | 16 ++++++ + src/testdir/test_cmdline.vim | 9 ++++ + src/testdir/test_ex_mode.vim | 22 +++++++++ + src/testdir/test_excmd.vim | 37 ++++++++++++++ + src/testdir/test_quickfix.vim | 15 ++++++ + src/testdir/test_sort.vim | 16 ++++++ + src/testdir/test_source.vim | 10 ++++ + src/testdir/test_substitute.vim | 2 ++ + src/testdir/test_undo.vim | 2 + + src/testdir/test_vimscript.vim | 87 +++++++++++++++++++++++++++++++++ + src/testdir/test_window_cmd.vim | 14 ++++++ + 12 files changed, 247 insertions(+) + +diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim +index e5a5e89..d4ad0f5 100644 +--- a/src/testdir/test_arglist.vim ++++ b/src/testdir/test_arglist.vim +@@ -1,5 +1,8 @@ + " Test argument list commands + ++source shared.vim ++source term_util.vim ++ + func Test_argidx() + args a b c + last +@@ -517,3 +520,17 @@ func Test_clear_arglist_in_all() + call assert_fails("all", "E1156") + au! * + endfunc ++ ++" Test for quiting Vim with unedited files in the argument list ++func Test_quit_with_arglist() ++ if !CanRunVimInTerminal() ++ throw 'Skipped: cannot run vim in terminal' ++ endif ++ let buf = RunVimInTerminal('', {'rows': 6}) ++ call term_sendkeys(buf, ":args a b c\n") ++ call term_sendkeys(buf, ":quit\n") ++ call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))}) ++ call StopVimInTerminal(buf) ++endfunc ++ ++" vim: shiftwidth=2 sts=2 expandtab +diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim +index bdb26cd..0e63538 100644 +--- a/src/testdir/test_cd.vim ++++ b/src/testdir/test_cd.vim +@@ -1,5 +1,7 @@ + " Test for :cd and chdir() + ++source shared.vim ++ + func Test_cd_large_path() + " This used to crash with a heap write overflow. + call assert_fails('cd ' . repeat('x', 5000), 'E472:') +@@ -40,6 +42,20 @@ func Test_cd_minus() + call assert_equal(path_dotdot, getcwd()) + cd - + call assert_equal(path, getcwd()) ++ ++ " Test for :cd - without a previous directory ++ let lines =<< trim [SCRIPT] ++ call assert_fails('cd -', 'E186:') ++ call assert_fails('call chdir("-")', 'E186:') ++ call writefile(v:errors, 'Xresult') ++ qall! ++ [SCRIPT] ++ call writefile(lines, 'Xscript') ++ if RunVim([], [], '--clean -S Xscript') ++ call assert_equal([], readfile('Xresult')) ++ endif ++ call delete('Xscript') ++ call delete('Xresult') + endfunc + + func Test_cd_with_cpo_chdir() +diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim +index f3860b7..41b36e7 100644 +--- a/src/testdir/test_cmdline.vim ++++ b/src/testdir/test_cmdline.vim +@@ -943,4 +943,13 @@ func Test_cmdwin_virtual_edit() + set ve= cpo-=$ + endfunc + ++" Test for failure in expanding special keywords in cmdline ++func Test_cmdline_expand_special() ++ %bwipe! ++ call assert_fails('e #', 'E499:') ++ call assert_fails('e ', 'E495:') ++ call assert_fails('e ', 'E496:') ++ call assert_fails('e ', 'E497:') ++endfunc ++ + " vim: shiftwidth=2 sts=2 expandtab +diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim +index 00a35a3..3842fc3 100644 +--- a/src/testdir/test_ex_mode.vim ++++ b/src/testdir/test_ex_mode.vim +@@ -52,3 +52,25 @@ func Test_ex_mode() + set sw& + let &encoding = encoding_save + endfunc ++ ++" Test for displaying lines from an empty buffer in Ex mode ++func Test_Ex_emptybuf() ++ new ++ call assert_fails('call feedkeys("Q\", "xt")', 'E749:') ++ call setline(1, "abc") ++ call assert_fails('call feedkeys("Q\", "xt")', 'E501:') ++ call assert_fails('call feedkeys("Q%d\", "xt")', 'E749:') ++ close! ++endfunc ++ ++" Test for the :open command ++func Test_open_command() ++ new ++ call setline(1, ['foo foo', 'foo bar', 'foo baz']) ++ call feedkeys("Qopen\j", 'xt') ++ call assert_equal('foo bar', getline('.')) ++ call feedkeys("Qopen /bar/\", 'xt') ++ call assert_equal(5, col('.')) ++ call assert_fails('call feedkeys("Qopen /baz/\", "xt")', 'E479:') ++ close! ++endfunc +diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim +index 17d9028..98b74fc 100644 +--- a/src/testdir/test_excmd.vim ++++ b/src/testdir/test_excmd.vim +@@ -18,6 +18,7 @@ func Test_range_error() + call assert_fails(':\/echo 1', 'E481:') + normal vv + call assert_fails(":'<,'>echo 1", 'E481:') ++ call assert_fails(":\\xcenter", 'E10:') + endfunc + + func Test_buffers_lastused() +@@ -53,3 +54,39 @@ func Test_using_zero_in_range() + bwipe! + endfunc + ++" Test for the :print command ++func Test_print_cmd() ++ call assert_fails('print', 'E749:') ++endfunc ++ ++" Test for the :winsize command ++func Test_winsize_cmd() ++ call assert_fails('winsize 1', 'E465:') ++endfunc ++ ++" Test for the :redir command ++func Test_redir_cmd() ++ call assert_fails('redir @@', 'E475:') ++ call assert_fails('redir abc', 'E475:') ++ if has('unix') ++ call mkdir('Xdir') ++ call assert_fails('redir > Xdir', 'E17:') ++ call delete('Xdir', 'd') ++ endif ++ if !has('bsd') ++ call writefile([], 'Xfile') ++ call setfperm('Xfile', 'r--r--r--') ++ call assert_fails('redir! > Xfile', 'E190:') ++ call delete('Xfile') ++ endif ++endfunc ++ ++" Test for the :filetype command ++func Test_filetype_cmd() ++ call assert_fails('filetype abc', 'E475:') ++endfunc ++ ++" Test for the :mode command ++func Test_mode_cmd() ++ call assert_fails('mode abc', 'E359:') ++endfunc +diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim +index 72f3172..a3dfaa9 100644 +--- a/src/testdir/test_quickfix.vim ++++ b/src/testdir/test_quickfix.vim +@@ -2810,6 +2810,21 @@ func Test_vimgrep_incsearch() + set noincsearch + endfunc + ++" Test vimgrep with the last search pattern not set ++func Test_vimgrep_with_no_last_search_pat() ++ let lines =<< trim [SCRIPT] ++ call assert_fails('vimgrep // *', 'E35:') ++ call writefile(v:errors, 'Xresult') ++ qall! ++ [SCRIPT] ++ call writefile(lines, 'Xscript') ++ if RunVim([], [], '--clean -S Xscript') ++ call assert_equal([], readfile('Xresult')) ++ endif ++ call delete('Xscript') ++ call delete('Xresult') ++endfunc ++ + func XfreeTests(cchar) + call s:setup_commands(a:cchar) + +diff --git a/src/testdir/test_sort.vim b/src/testdir/test_sort.vim +index 7da82b0..4332664 100644 +--- a/src/testdir/test_sort.vim ++++ b/src/testdir/test_sort.vim +@@ -1322,3 +1322,19 @@ func Test_sort_cmd_report() + call assert_match("6 fewer lines", res) + enew! + endfunc ++ ++" Test for :sort with no last search pattern ++func Test_sort_with_no_last_search_pat() ++ let lines =<< trim [SCRIPT] ++ call setline(1, ['3b', '1c', '2a']) ++ call assert_fails('sort //', 'E35:') ++ call writefile(v:errors, 'Xresult') ++ qall! ++ [SCRIPT] ++ call writefile(lines, 'Xscript') ++ if RunVim([], [], '--clean -S Xscript') ++ call assert_equal([], readfile('Xresult')) ++ endif ++ call delete('Xscript') ++ call delete('Xresult') ++endfunc +diff --git a/src/testdir/test_source.vim b/src/testdir/test_source.vim +index 09baec0..1d6bff0 100644 +--- a/src/testdir/test_source.vim ++++ b/src/testdir/test_source.vim +@@ -46,3 +46,13 @@ func Test_source_sandbox() + bwipe! + call delete('Xsourcehello') + endfunc ++ ++" When sourcing a vim script, shebang should be ignored. ++func Test_source_ignore_shebang() ++ call writefile(['#!./xyzabc', 'let g:val=369'], 'Xfile.vim') ++ source Xfile.vim ++ call assert_equal(g:val, 369) ++ call delete('Xfile.vim') ++endfunc ++ ++" vim: shiftwidth=2 sts=2 expandtab +diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim +index c590005..4cdbc15 100644 +--- a/src/testdir/test_substitute.vim ++++ b/src/testdir/test_substitute.vim +@@ -1,5 +1,7 @@ + " Tests for multi-line regexps with ":s". + ++source shared.vim ++ + func Test_multiline_subst() + enew! + call append(0, ["1 aa", +diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim +index 12d835b..79944d9 100644 +--- a/src/testdir/test_undo.vim ++++ b/src/testdir/test_undo.vim +@@ -275,6 +275,8 @@ func Test_undo_write() + close! + call delete('Xtest') + bwipe! Xtest ++ ++ call assert_fails('earlier xyz', 'E475:') + endfunc + + func Test_insert_expr() +diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim +index 89112de..90f1f56 100644 +--- a/src/testdir/test_vimscript.vim ++++ b/src/testdir/test_vimscript.vim +@@ -3,6 +3,7 @@ + + source check.vim + source shared.vim ++source term_util.vim + + "------------------------------------------------------------------------------- + " Test environment {{{1 +@@ -1944,6 +1945,92 @@ func Test_function_defined_line() + call delete('Xtest.vim') + endfunc + ++" Test for missing :endif, :endfor, :endwhile and :endtry {{{1 ++func Test_missing_end() ++ call writefile(['if 2 > 1', 'echo ">"'], 'Xscript') ++ call assert_fails('source Xscript', 'E171:') ++ call writefile(['for i in range(5)', 'echo i'], 'Xscript') ++ call assert_fails('source Xscript', 'E170:') ++ call writefile(['while v:true', 'echo "."'], 'Xscript') ++ call assert_fails('source Xscript', 'E170:') ++ call writefile(['try', 'echo "."'], 'Xscript') ++ call assert_fails('source Xscript', 'E600:') ++ call delete('Xscript') ++endfunc ++ ++" Test for deep nesting of if/for/while/try statements {{{1 ++func Test_deep_nest() ++ if !CanRunVimInTerminal() ++ throw 'Skipped: cannot run vim in terminal' ++ endif ++ ++ let lines =<< trim [SCRIPT] ++ " Deep nesting of if ... endif ++ func Test1() ++ let @a = join(repeat(['if v:true'], 51), "\n") ++ let @a ..= "\n" ++ let @a ..= join(repeat(['endif'], 51), "\n") ++ @a ++ let @a = '' ++ endfunc ++ ++ " Deep nesting of for ... endfor ++ func Test2() ++ let @a = join(repeat(['for i in [1]'], 51), "\n") ++ let @a ..= "\n" ++ let @a ..= join(repeat(['endfor'], 51), "\n") ++ @a ++ let @a = '' ++ endfunc ++ ++ " Deep nesting of while ... endwhile ++ func Test3() ++ let @a = join(repeat(['while v:true'], 51), "\n") ++ let @a ..= "\n" ++ let @a ..= join(repeat(['endwhile'], 51), "\n") ++ @a ++ let @a = '' ++ endfunc ++ ++ " Deep nesting of try ... endtry ++ func Test4() ++ let @a = join(repeat(['try'], 51), "\n") ++ let @a ..= "\necho v:true\n" ++ let @a ..= join(repeat(['endtry'], 51), "\n") ++ @a ++ let @a = '' ++ endfunc ++ [SCRIPT] ++ call writefile(lines, 'Xscript') ++ ++ let buf = RunVimInTerminal('-S Xscript', {'rows': 6}) ++ ++ " Deep nesting of if ... endif ++ call term_sendkeys(buf, ":call Test1()\n") ++ call WaitForAssert({-> assert_match('^E579:', term_getline(buf, 5))}) ++ ++ " Deep nesting of for ... endfor ++ call term_sendkeys(buf, ":call Test2()\n") ++ call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))}) ++ ++ " Deep nesting of while ... endwhile ++ call term_sendkeys(buf, ":call Test3()\n") ++ call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))}) ++ ++ " Deep nesting of try ... endtry ++ call term_sendkeys(buf, ":call Test4()\n") ++ call WaitForAssert({-> assert_match('^E601:', term_getline(buf, 5))}) ++ ++ "let l = '' ++ "for i in range(1, 6) ++ " let l ..= term_getline(buf, i) . "\n" ++ "endfor ++ "call assert_report(l) ++ ++ call StopVimInTerminal(buf) ++ call delete('Xscript') ++endfunc ++ + "------------------------------------------------------------------------------- + " Modelines {{{1 + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker +diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim +index d543ef7..2eb415f 100644 +--- a/src/testdir/test_window_cmd.vim ++++ b/src/testdir/test_window_cmd.vim +@@ -929,4 +929,18 @@ func Test_win_splitmove() + call assert_fails('call win_splitmove(winnr(), winnr())', 'E957:') + endfunc + ++" Test for errors with :wincmd ++func Test_wincmd_errors() ++ call assert_fails('wincmd g', 'E474:') ++ call assert_fails('wincmd ab', 'E474:') ++endfunc ++ ++" Test for errors with :winpos ++func Test_winpos_errors() ++ if !has("gui_running") && !has('win32') ++ call assert_fails('winpos', 'E188:') ++ endif ++ call assert_fails('winpos 10', 'E466:') ++endfunc ++ + " vim: shiftwidth=2 sts=2 expandtab +-- +2.33.0 + diff --git a/backport-patch-8.2.0892-ubsan-warns-for-undefined-behavior.patch b/backport-patch-8.2.0892-ubsan-warns-for-undefined-behavior.patch new file mode 100644 index 0000000000000000000000000000000000000000..bc1f1b2d951f885374a87c107bcd40c7e955cd34 --- /dev/null +++ b/backport-patch-8.2.0892-ubsan-warns-for-undefined-behavior.patch @@ -0,0 +1,67 @@ +From c5acc0f7fed6b061d994fc5ac660dcc0312750bd Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 3 Jun 2020 18:55:38 +0200 +Subject: [PATCH] patch 8.2.0892: ubsan warns for undefined behavior + +Problem: Ubsan warns for undefined behavior. +Solution: Use unsigned instead of signed variable. (Dominique Pelle, + closes #6193) +--- + src/regexp_nfa.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c +index 433523e..100626f 100644 +--- a/src/regexp_nfa.c ++++ b/src/regexp_nfa.c +@@ -246,6 +246,7 @@ static int nfa_classcodes[] = { + static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely"); + static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c"); + static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %d"); ++static char_u e_value_too_large[] = N_("E951: \\% value too large"); + + // Variables only used in nfa_regcomp() and descendants. + static int nfa_re_flags; // re_flags passed to nfa_regcomp() +@@ -1541,19 +1542,27 @@ nfa_regatom(void) + + default: + { +- long n = 0; ++ long_u n = 0; + int cmp = c; + + if (c == '<' || c == '>') + c = getchr(); + while (VIM_ISDIGIT(c)) + { +- n = n * 10 + (c - '0'); ++ long_u tmp = n * 10 + (c - '0'); ++ ++ if (tmp < n) ++ { ++ // overflow. ++ emsg(_(e_value_too_large)); ++ return FAIL; ++ } ++ n = tmp; + c = getchr(); + } + if (c == 'l' || c == 'c' || c == 'v') + { +- int limit = INT_MAX; ++ long_u limit = INT_MAX; + + if (c == 'l') + { +@@ -1576,7 +1585,7 @@ nfa_regatom(void) + } + if (n >= limit) + { +- emsg(_("E951: \\% value too large")); ++ emsg(_(e_value_too_large)); + return FAIL; + } + EMIT((int)n); +-- +2.33.0 + diff --git a/backport-patch-8.2.0945-cannot-use-z-when-spell-is-off.patch b/backport-patch-8.2.0945-cannot-use-z-when-spell-is-off.patch new file mode 100644 index 0000000000000000000000000000000000000000..73acbb0fa90cb49e054c1a4df8243ff10f36b459 --- /dev/null +++ b/backport-patch-8.2.0945-cannot-use-z-when-spell-is-off.patch @@ -0,0 +1,257 @@ +From 152e79e94bb935e75b866bd55479648cde11066a Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 10 Jun 2020 15:32:08 +0200 +Subject: [PATCH] patch 8.2.0945: cannot use "z=" when 'spell' is off + +Problem: Cannot use "z=" when 'spell' is off. +Solution: Make "z=" work even when 'spell' is off. (Christian Brabandt, + Gary Johnson, closes #6227) +--- + runtime/doc/eval.txt | 8 +++---- + src/evalfunc.c | 46 ++++++++++++++++++++++++++++++++++++-- + src/globals.h | 3 +++ + src/spell.c | 2 +- + src/spellsuggest.c | 13 ++++++++++- + src/testdir/test_spell.vim | 37 +++++++++++++++++++++++++++--- + 6 files changed, 97 insertions(+), 12 deletions(-) + +diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt +index b28fac9..26f63ec 100644 +--- a/runtime/doc/eval.txt ++++ b/runtime/doc/eval.txt +@@ -9071,9 +9071,8 @@ spellbadword([{sentence}]) + echo spellbadword("the quik brown fox") + < ['quik', 'bad'] ~ + +- The spelling information for the current window is used. The +- 'spell' option must be set and the value of 'spelllang' is +- used. ++ The spelling information for the current window and the value ++ of 'spelllang' are used. + + Can also be used as a |method|: > + GetText()->spellbadword() +@@ -9098,8 +9097,7 @@ spellsuggest({word} [, {max} [, {capital}]]) + although it may appear capitalized. + + The spelling information for the current window is used. The +- 'spell' option must be set and the values of 'spelllang' and +- 'spellsuggest' are used. ++ values of 'spelllang' and 'spellsuggest' are used. + + Can also be used as a |method|: > + GetWord()->spellsuggest() +diff --git a/src/evalfunc.c b/src/evalfunc.c +index 892a753..d7ddfe2 100644 +--- a/src/evalfunc.c ++++ b/src/evalfunc.c +@@ -6903,9 +6903,30 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) + char_u *word = (char_u *)""; + hlf_T attr = HLF_COUNT; + int len = 0; ++#ifdef FEAT_SPELL ++ int wo_spell_save = curwin->w_p_spell; ++ ++ if (!curwin->w_p_spell) ++ { ++ did_set_spelllang(curwin); ++ curwin->w_p_spell = TRUE; ++ } ++ ++ if (*curwin->w_s->b_p_spl == NUL) ++ { ++ emsg(_(e_no_spell)); ++ curwin->w_p_spell = wo_spell_save; ++ return; ++ } ++#endif + + if (rettv_list_alloc(rettv) == FAIL) ++ { ++#ifdef FEAT_SPELL ++ curwin->w_p_spell = wo_spell_save; ++#endif + return; ++ } + + #ifdef FEAT_SPELL + if (argvars[0].v_type == VAR_UNKNOWN) +@@ -6918,7 +6939,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) + curwin->w_set_curswant = TRUE; + } + } +- else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL) ++ else if (*curbuf->b_s.b_p_spl != NUL) + { + char_u *str = tv_get_string_chk(&argvars[0]); + int capcol = -1; +@@ -6940,6 +6961,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) + } + } + } ++ curwin->w_p_spell = wo_spell_save; + #endif + + list_append_string(rettv->vval.v_list, word, len); +@@ -6965,13 +6987,32 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv) + int i; + listitem_T *li; + int need_capital = FALSE; ++ int wo_spell_save = curwin->w_p_spell; ++ ++ if (!curwin->w_p_spell) ++ { ++ did_set_spelllang(curwin); ++ curwin->w_p_spell = TRUE; ++ } ++ ++ if (*curwin->w_s->b_p_spl == NUL) ++ { ++ emsg(_(e_no_spell)); ++ curwin->w_p_spell = wo_spell_save; ++ return; ++ } + #endif + + if (rettv_list_alloc(rettv) == FAIL) ++ { ++#ifdef FEAT_SPELL ++ curwin->w_p_spell = wo_spell_save; ++#endif + return; ++ } + + #ifdef FEAT_SPELL +- if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) ++ if (*curwin->w_s->b_p_spl != NUL) + { + str = tv_get_string(&argvars[0]); + if (argvars[1].v_type != VAR_UNKNOWN) +@@ -7008,6 +7049,7 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv) + } + ga_clear(&ga); + } ++ curwin->w_p_spell = wo_spell_save; + #endif + } + +diff --git a/src/globals.h b/src/globals.h +index 01ebbb8..4d40de4 100644 +--- a/src/globals.h ++++ b/src/globals.h +@@ -1502,6 +1502,9 @@ EXTERN char e_invcmd[] INIT(= N_("E476: Invalid command")); + #if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL) + EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory")); + #endif ++#ifdef FEAT_SPELL ++EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible")); ++#endif + #ifdef FEAT_LIBCALL + EXTERN char e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\"")); + #endif +diff --git a/src/spell.c b/src/spell.c +index 82ba756..1d7a1ae 100644 +--- a/src/spell.c ++++ b/src/spell.c +@@ -1225,7 +1225,7 @@ no_spell_checking(win_T *wp) + if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL + || wp->w_s->b_langp.ga_len == 0) + { +- emsg(_("E756: Spell checking is not enabled")); ++ emsg(_(e_no_spell)); + return TRUE; + } + return FALSE; +diff --git a/src/spellsuggest.c b/src/spellsuggest.c +index 379d9ba..ee98913 100644 +--- a/src/spellsuggest.c ++++ b/src/spellsuggest.c +@@ -471,9 +471,19 @@ spell_suggest(int count) + int selected = count; + int badlen = 0; + int msg_scroll_save = msg_scroll; ++ int wo_spell_save = curwin->w_p_spell; + +- if (no_spell_checking(curwin)) ++ if (!curwin->w_p_spell) ++ { ++ did_set_spelllang(curwin); ++ curwin->w_p_spell = TRUE; ++ } ++ ++ if (*curwin->w_s->b_p_spl == NUL) ++ { ++ emsg(_(e_no_spell)); + return; ++ } + + if (VIsual_active) + { +@@ -691,6 +701,7 @@ spell_suggest(int count) + spell_find_cleanup(&sug); + skip: + vim_free(line); ++ curwin->w_p_spell = wo_spell_save; + } + + /* +diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim +index c7379d5..bc4f41d 100644 +--- a/src/testdir/test_spell.vim ++++ b/src/testdir/test_spell.vim +@@ -109,11 +109,14 @@ foobar/? + set spelllang=Xwords.spl + call assert_equal(['foobar', 'rare'], spellbadword('foo foobar')) + +- " Typo should not be detected without the 'spell' option. ++ " Typo should be detected even without the 'spell' option. + set spelllang=en_gb nospell + call assert_equal(['', ''], spellbadword('centre')) +- call assert_equal(['', ''], spellbadword('My bycycle.')) +- call assert_equal(['', ''], spellbadword('A sentence. another sentence')) ++ call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) ++ call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence')) ++ ++ set spelllang= ++ call assert_fails("call spellbadword('maxch')", 'E756:') + + call delete('Xwords.spl') + call delete('Xwords') +@@ -452,6 +455,34 @@ func Test_zeq_crash() + bwipe! + endfunc + ++" Check that z= works even when 'nospell' is set. This test uses one of the ++" tests in Test_spellsuggest_option_number() just to verify that z= basically ++" works and that "E756: Spell checking is not enabled" is not generated. ++func Test_zeq_nospell() ++ new ++ set nospell spellsuggest=1,best ++ call setline(1, 'A baord') ++ try ++ norm $1z= ++ call assert_equal('A board', getline(1)) ++ catch ++ call assert_report("Caught exception: " . v:exception) ++ endtry ++ set spell& spellsuggest& ++ bwipe! ++endfunc ++ ++" Check that "E756: Spell checking is not possible" is reported when z= is ++" executed and 'spelllang' is empty. ++func Test_zeq_no_spelllang() ++ new ++ set spelllang= spellsuggest=1,best ++ call setline(1, 'A baord') ++ call assert_fails('normal $1z=', 'E756:') ++ set spelllang& spellsuggest& ++ bwipe! ++endfunc ++ + " Check handling a word longer than MAXWLEN. + func Test_spell_long_word() + set enc=utf-8 +-- +2.33.0 + diff --git a/backport-patch-8.2.3110-pattern-that-matches-the-cursor-posit.patch b/backport-patch-8.2.3110-pattern-that-matches-the-cursor-posit.patch new file mode 100644 index 0000000000000000000000000000000000000000..8a040e8e77e8e464239f8d1ea5caa9e311c131ff --- /dev/null +++ b/backport-patch-8.2.3110-pattern-that-matches-the-cursor-posit.patch @@ -0,0 +1,246 @@ +From 04db26b36000a4677b95403ec94bd11f6cc73975 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Mon, 5 Jul 2021 20:15:23 +0200 +Subject: [PATCH] patch 8.2.3110: a pattern that matches the cursor position is + complicated + +Problem: A pattern that matches the cursor position is bit complicated. +Solution: Use a dot to indicate the cursor line and column. (Christian + Brabandt, closes #8497, closes #8179) +--- + runtime/doc/pattern.txt | 31 +++++++++++++++++++++++++++---- + src/globals.h | 3 +++ + src/regexp_bt.c | 34 +++++++++++++++++++++++++++++++++- + src/regexp_nfa.c | 30 +++++++++++++++++++++++++++++- + 4 files changed, 92 insertions(+), 6 deletions(-) + +diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt +index 7ba46e2..9cc74ff 100644 +--- a/runtime/doc/pattern.txt ++++ b/runtime/doc/pattern.txt +@@ -922,13 +922,20 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): + \%23l Matches in a specific line. + \%<23l Matches above a specific line (lower line number). + \%>23l Matches below a specific line (higher line number). ++\%.l Matches at the cursor line. ++\%<.l Matches above the cursor line. ++\%>.l Matches below the cursor line. + These three can be used to match specific lines in a buffer. The "23" + can be any line number. The first line is 1. + WARNING: When inserting or deleting lines Vim does not automatically + update the matches. This means Syntax highlighting quickly becomes +- wrong. ++ wrong. Also when refering to the cursor position (".") and ++ the cursor moves the display isn't updated for this change. An update ++ is done when using the |CTRL-L| command (the whole screen is updated). + Example, to highlight the line where the cursor currently is: > +- :exe '/\%' . line(".") . 'l.*' ++ :exe '/\%' . line(".") . 'l' ++< Alternatively use: > ++ /\%.l + < When 'hlsearch' is set and you move the cursor around and make changes + this will clearly show when the match is updated or not. + +@@ -936,15 +943,23 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): + \%23c Matches in a specific column. + \%<23c Matches before a specific column. + \%>23c Matches after a specific column. ++\%.c Matches at the cursor column. ++\%<.c Matches before the cursor column. ++\%>.c Matches after the cursor column. + These three can be used to match specific columns in a buffer or + string. The "23" can be any column number. The first column is 1. + Actually, the column is the byte number (thus it's not exactly right + for multi-byte characters). + WARNING: When inserting or deleting text Vim does not automatically + update the matches. This means Syntax highlighting quickly becomes +- wrong. ++ wrong. Also when refering to the cursor position (".") and ++ the cursor moves the display isn't updated for this change. An update ++ is done when using the |CTRL-L| command (the whole screen is updated). ++ + Example, to highlight the column where the cursor currently is: > + :exe '/\%' . col(".") . 'c' ++< Alternatively use: > ++ /\%.c + < When 'hlsearch' is set and you move the cursor around and make changes + this will clearly show when the match is updated or not. + Example for matching a single byte in column 44: > +@@ -955,6 +970,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): + \%23v Matches in a specific virtual column. + \%<23v Matches before a specific virtual column. + \%>23v Matches after a specific virtual column. ++\%.v Matches at the current virtual column. ++\%<.v Matches before the current virtual column. ++\%>.v Matches after the current virtual column. + These three can be used to match specific virtual columns in a buffer + or string. When not matching with a buffer in a window, the option + values of the current window are used (e.g., 'tabstop'). +@@ -964,13 +982,18 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): + one screen character. + WARNING: When inserting or deleting text Vim does not automatically + update highlighted matches. This means Syntax highlighting quickly +- becomes wrong. ++ becomes wrong. Also when refering to the cursor position (".") and ++ the cursor moves the display isn't updated for this change. An update ++ is done when using the |CTRL-L| command (the whole screen is updated). + Example, to highlight all the characters after virtual column 72: > + /\%>72v.* + < When 'hlsearch' is set and you move the cursor around and make changes + this will clearly show when the match is updated or not. + To match the text up to column 17: > + /^.*\%17v ++< To match all characters after the current virtual column (where the ++ cursor is): > ++ /\%>.v.* + < Column 17 is not included, because this is a |/zero-width| match. To + include the column use: > + /^.*\%17v. +diff --git a/src/globals.h b/src/globals.h +index 4d40de4..cbd455b 100644 +--- a/src/globals.h ++++ b/src/globals.h +@@ -1761,3 +1761,6 @@ EXTERN char e_illegal_character_in_word[] + + EXTERN char e_command_too_recursive[] + INIT(= N_("E169: Command too recursive")); ++ ++EXTERN char e_regexp_number_after_dot_pos_search[] ++ INIT(= N_("E1204: No Number allowed after .: '\\%%%c'")); +diff --git a/src/regexp_bt.c b/src/regexp_bt.c +index ff92576..73a9174 100644 +--- a/src/regexp_bt.c ++++ b/src/regexp_bt.c +@@ -1462,14 +1462,20 @@ regatom(int *flagp) + + default: + if (VIM_ISDIGIT(c) || c == '<' || c == '>' +- || c == '\'') ++ || c == '\'' || c == '.') + { + long_u n = 0; + int cmp; ++ int cur = FALSE; + + cmp = c; + if (cmp == '<' || cmp == '>') + c = getchr(); ++ if (no_Magic(c) == '.') ++ { ++ cur = TRUE; ++ c = getchr(); ++ } + while (VIM_ISDIGIT(c)) + { + n = n * 10 + (c - '0'); +@@ -1491,16 +1497,42 @@ regatom(int *flagp) + } + else if (c == 'l' || c == 'c' || c == 'v') + { ++ if (cur && n) ++ { ++ semsg(_(e_regexp_number_after_dot_pos_search), no_Magic(c)); ++ rc_did_emsg = TRUE; ++ return NULL; ++ } + if (c == 'l') + { ++ if (cur) ++ n = curwin->w_cursor.lnum; + ret = regnode(RE_LNUM); + if (save_prev_at_start) + at_start = TRUE; + } + else if (c == 'c') ++ { ++ if (cur) ++ { ++ n = curwin->w_cursor.col; ++ n++; ++ } + ret = regnode(RE_COL); ++ } + else ++ { ++ if (cur) ++ { ++ colnr_T vcol = 0; ++ ++ getvvcol(curwin, &curwin->w_cursor, ++ NULL, NULL, &vcol); ++ ++vcol; ++ n = vcol; ++ } + ret = regnode(RE_VCOL); ++ } + if (ret == JUST_CALC_SIZE) + regsize += 5; + else +diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c +index 100626f..a7ca000 100644 +--- a/src/regexp_nfa.c ++++ b/src/regexp_nfa.c +@@ -1544,12 +1544,23 @@ nfa_regatom(void) + { + long_u n = 0; + int cmp = c; ++ int cur = FALSE; + + if (c == '<' || c == '>') + c = getchr(); ++ if (no_Magic(c) == '.') ++ { ++ cur = TRUE; ++ c = getchr(); ++ } + while (VIM_ISDIGIT(c)) + { +- long_u tmp = n * 10 + (c - '0'); ++ long_u tmp; ++ ++ if (cur) ++ semsg(_(e_regexp_number_after_dot_pos_search), ++ no_Magic(c)); ++ tmp = n * 10 + (c - '0'); + + if (tmp < n) + { +@@ -1566,6 +1577,8 @@ nfa_regatom(void) + + if (c == 'l') + { ++ if (cur) ++ n = curwin->w_cursor.lnum; + // \%{n}l \%{n}l + EMIT(cmp == '<' ? NFA_LNUM_LT : + cmp == '>' ? NFA_LNUM_GT : NFA_LNUM); +@@ -1573,11 +1586,26 @@ nfa_regatom(void) + at_start = TRUE; + } + else if (c == 'c') ++ { ++ if (cur) ++ { ++ n = curwin->w_cursor.col; ++ n++; ++ } + // \%{n}c \%{n}c + EMIT(cmp == '<' ? NFA_COL_LT : + cmp == '>' ? NFA_COL_GT : NFA_COL); ++ } + else + { ++ if (cur) ++ { ++ colnr_T vcol = 0; ++ ++ getvvcol(curwin, &curwin->w_cursor, ++ NULL, NULL, &vcol); ++ n = ++vcol; ++ } + // \%{n}v \%{n}v + EMIT(cmp == '<' ? NFA_VCOL_LT : + cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); +-- +2.33.0 + diff --git a/backport-patch-8.2.4152-block-insert-with-double-wide-character-fails.patch b/backport-patch-8.2.4152-block-insert-with-double-wide-character-fails.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa71e06e787124dd72555d850a8d47816f65282f --- /dev/null +++ b/backport-patch-8.2.4152-block-insert-with-double-wide-character-fails.patch @@ -0,0 +1,26 @@ +From fc6ccebea668c49e9e617e0657421b6a8ed9df1e Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Thu, 20 Jan 2022 12:22:35 +0000 +Subject: [PATCH] patch 8.2.4152: block insert with double wide character fails + +Problem: Block insert with double wide character fails. +Solution: Adjust the expected output. +--- + src/testdir/test_utf8.vim | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim +index 42a46fd..32cec0f 100644 +--- a/src/testdir/test_utf8.vim ++++ b/src/testdir/test_utf8.vim +@@ -7,7 +7,7 @@ func Test_visual_block_insert() + new + call setline(1, ["aaa", "あああ", "bbb"]) + exe ":norm! gg0l\jjIx\" +- call assert_equal(['axaa', 'xあああ', 'bxbb'], getline(1, '$')) ++ call assert_equal(['axaa', ' xあああ', 'bxbb'], getline(1, '$')) + bwipeout! + endfunc + +-- +2.27.0 diff --git a/openEuler-adapt-test87-failed.patch b/openEuler-adapt-test87-failed.patch new file mode 100644 index 0000000000000000000000000000000000000000..16c252250b2342cbd5b86acd76acc5217eef42fd --- /dev/null +++ b/openEuler-adapt-test87-failed.patch @@ -0,0 +1,46 @@ +From bac247b1f2043aaafb2aa618cd2b767545c5ece4 Mon Sep 17 00:00:00 2001 +From: root +Date: Wed, 31 Aug 2022 10:33:35 +0800 +Subject: [PATCH] shipei test87 failed + +--- + src/testdir/test87.ok | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok +index 7ddea8f..00902f6 100644 +--- a/src/testdir/test87.ok ++++ b/src/testdir/test87.ok +@@ -672,7 +672,7 @@ vim.command(1):(, TypeError('expected bytes() or str() instan + vim.command(b"\0"):(, TypeError('expected bytes with no null',)) + vim.command("\0"):(, TypeError('expected bytes with no null',)) + <<< Finished +-vim.command("", 2):(, TypeError('command() takes exactly one argument (2 given)',)) ++vim.command("", 2):(, TypeError('vim.command() takes exactly one argument (2 given)',)) + > VimToPython + > VimEval + >>> Testing StringToChars using vim.eval(%s) +@@ -698,7 +698,7 @@ vim.strwidth("\0"):(, TypeError('expected bytes with no null' + vim.foreach_rtp(None):(, TypeError("'NoneType' object is not callable",)) + vim.foreach_rtp(NoArgsCall()):(, TypeError('__call__() takes exactly 1 positional argument (2 given)',)) + vim.foreach_rtp(FailingCall()):(, NotImplementedError('call',)) +-vim.foreach_rtp(int, 2):(, TypeError('foreach_rtp() takes exactly one argument (2 given)',)) ++vim.foreach_rtp(int, 2):(, TypeError('vim.foreach_rtp() takes exactly one argument (2 given)',)) + > import + import xxx_no_such_module_xxx:(, ImportError('No module named xxx_no_such_module_xxx',)) + import failing_import:(, ImportError()) +@@ -962,9 +962,9 @@ d.update((("a", FailingMappingKey()),)):(, NotImple + d.update((("a", FailingNumber()),)):(, NotImplementedError('int',)) + <<< Finished + >> DictionaryPopItem +-d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) ++d.popitem(1, 2):(, TypeError('dictionary.popitem() takes no arguments (2 given)',)) + >> DictionaryHasKey +-d.has_key():(, TypeError('has_key() takes exactly one argument (0 given)',)) ++d.has_key():(, TypeError('dictionary.has_key() takes exactly one argument (0 given)',)) + > List + >> ListConstructor + vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) +-- +2.33.0 + diff --git a/openEuler-remove-failed-tests-due-to-patch.patch b/openEuler-remove-failed-tests-due-to-patch.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d67f2304398ab22eeac8a4331ae081705193f94 --- /dev/null +++ b/openEuler-remove-failed-tests-due-to-patch.patch @@ -0,0 +1,779 @@ +From ca7a7ce78d3c12d4c9ed458a7c67866be60aabe8 Mon Sep 17 00:00:00 2001 +From: wangshouping +Date: Sat, 6 Mar 2021 20:55:26 +0800 +Subject: [PATCH] remove test cases of failure due to patch + +reason: Remove test cases of failure due to vim-7.4-syntax.patch/ + vim-8.0-copy-paste.patch/vim-7.4-syncolor.patch. + +Signed-off-by: wangshouping +--- + src/testdir/test_balloon.vim | 47 ---- + src/testdir/test_diffmode.vim | 181 ---------------- + src/testdir/test_filetype.vim | 9 - + src/testdir/test_popupwin.vim | 285 ------------------------- + src/testdir/test_popupwin_textprop.vim | 166 -------------- + 5 files changed, 688 deletions(-) + +diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim +index f32b73c..b7d1a15 100644 +--- a/src/testdir/test_balloon.vim ++++ b/src/testdir/test_balloon.vim +@@ -17,50 +17,3 @@ let s:common_script =<< trim [CODE] + redraw + [CODE] + +-func Test_balloon_eval_term() +- " Use after to return from vgetc() without removing +- " the balloon. +- let xtra_lines =<< trim [CODE] +- set updatetime=300 +- au CursorHold * echo 'hold fired' +- func Trigger() +- call test_setmouse(2, 6) +- call feedkeys("\\", "xt") +- endfunc +- [CODE] +- call writefile(s:common_script + xtra_lines, 'XTest_beval') +- +- " Check that the balloon shows up after a mouse move +- let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50}) +- call term_wait(buf, 100) +- call term_sendkeys(buf, 'll') +- call term_sendkeys(buf, ":call Trigger()\") +- call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {}) +- +- " Make sure the balloon still shows after 'updatetime' passed and CursorHold +- " was triggered. +- call term_wait(buf, 300) +- call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XTest_beval') +-endfunc +- +-func Test_balloon_eval_term_visual() +- " Use after to return from vgetc() without removing +- " the balloon. +- call writefile(s:common_script + [ +- \ 'call test_setmouse(3, 6)', +- \ 'call feedkeys("3Gevfr\\", "xt")', +- \ ], 'XTest_beval_visual') +- +- " Check that the balloon shows up after a mouse move +- let buf = RunVimInTerminal('-S XTest_beval_visual', {'rows': 10, 'cols': 50}) +- call term_wait(buf, 100) +- call VerifyScreenDump(buf, 'Test_balloon_eval_term_02', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XTest_beval_visual') +-endfunc +diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim +index 9dfe2fe..61edbe2 100644 +--- a/src/testdir/test_diffmode.vim ++++ b/src/testdir/test_diffmode.vim +@@ -749,163 +749,6 @@ func VerifyInternal(buf, dumpfile, extra) + call VerifyScreenDump(a:buf, a:dumpfile, {}) + endfunc + +-func Test_diff_screen() +- CheckScreendump +- CheckFeature menu +- +- " clean up already existing swap files, just in case +- call delete('.Xfile1.swp') +- call delete('.Xfile2.swp') +- +- " Test 1: Add a line in beginning of file 2 +- call WriteDiffFiles(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) +- let buf = RunVimInTerminal('-d Xfile1 Xfile2', {}) +- " Set autoread mode, so that Vim won't complain once we re-write the test +- " files +- call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") +- +- call VerifyBoth(buf, 'Test_diff_01', '') +- +- " Test 2: Add a line in beginning of file 1 +- call WriteDiffFiles(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) +- call VerifyBoth(buf, 'Test_diff_02', '') +- +- " Test 3: Add a line at the end of file 2 +- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) +- call VerifyBoth(buf, 'Test_diff_03', '') +- +- " Test 4: Add a line at the end of file 1 +- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) +- call VerifyBoth(buf, 'Test_diff_04', '') +- +- " Test 5: Add a line in the middle of file 2, remove on at the end of file 1 +- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10]) +- call VerifyBoth(buf, 'Test_diff_05', '') +- +- " Test 6: Add a line in the middle of file 1, remove on at the end of file 2 +- call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) +- call VerifyBoth(buf, 'Test_diff_06', '') +- +- " Variants on test 6 with different context settings +- call term_sendkeys(buf, ":set diffopt+=context:2\") +- call VerifyScreenDump(buf, 'Test_diff_06.2', {}) +- call term_sendkeys(buf, ":set diffopt-=context:2\") +- call term_sendkeys(buf, ":set diffopt+=context:1\") +- call VerifyScreenDump(buf, 'Test_diff_06.1', {}) +- call term_sendkeys(buf, ":set diffopt-=context:1\") +- call term_sendkeys(buf, ":set diffopt+=context:0\") +- call VerifyScreenDump(buf, 'Test_diff_06.0', {}) +- call term_sendkeys(buf, ":set diffopt-=context:0\") +- +- " Test 7 - 9: Test normal/patience/histogram diff algorithm +- call WriteDiffFiles(buf, ['#include ', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{', +- \ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");', +- \ ' printf("%d\n", foo);', ' }', '}', '', 'int fact(int n)', '{', ' if(n > 1)', ' {', +- \ ' return fact(n-1) * n;', ' }', ' return 1;', '}', '', 'int main(int argc, char **argv)', +- \ '{', ' frobnitz(fact(10));', '}'], +- \ ['#include ', '', 'int fib(int n)', '{', ' if(n > 2)', ' {', +- \ ' return fib(n-1) + fib(n-2);', ' }', ' return 1;', '}', '', '// Frobs foo heartily', +- \ 'int frobnitz(int foo)', '{', ' int i;', ' for(i = 0; i < 10; i++)', ' {', +- \ ' printf("%d\n", foo);', ' }', '}', '', +- \ 'int main(int argc, char **argv)', '{', ' frobnitz(fib(10));', '}']) +- call term_sendkeys(buf, ":diffupdate!\") +- call term_sendkeys(buf, ":set diffopt+=internal\") +- call VerifyScreenDump(buf, 'Test_diff_07', {}) +- +- call term_sendkeys(buf, ":set diffopt+=algorithm:patience\") +- call VerifyScreenDump(buf, 'Test_diff_08', {}) +- +- call term_sendkeys(buf, ":set diffopt+=algorithm:histogram\") +- call VerifyScreenDump(buf, 'Test_diff_09', {}) +- +- " Test 10-11: normal/indent-heuristic +- call term_sendkeys(buf, ":set diffopt&vim\") +- call WriteDiffFiles(buf, ['', ' def finalize(values)', '', ' values.each do |v|', ' v.finalize', ' end'], +- \ ['', ' def finalize(values)', '', ' values.each do |v|', ' v.prepare', ' end', '', +- \ ' values.each do |v|', ' v.finalize', ' end']) +- call term_sendkeys(buf, ":diffupdate!\") +- call term_sendkeys(buf, ":set diffopt+=internal\") +- call VerifyScreenDump(buf, 'Test_diff_10', {}) +- +- " Leave trailing : at commandline! +- call term_sendkeys(buf, ":set diffopt+=indent-heuristic\:\") +- call VerifyScreenDump(buf, 'Test_diff_11', {}, 'one') +- " shouldn't matter, if indent-algorithm comes before or after the algorithm +- call term_sendkeys(buf, ":set diffopt&\") +- call term_sendkeys(buf, ":set diffopt+=indent-heuristic,algorithm:patience\:\") +- call VerifyScreenDump(buf, 'Test_diff_11', {}, 'two') +- call term_sendkeys(buf, ":set diffopt&\") +- call term_sendkeys(buf, ":set diffopt+=algorithm:patience,indent-heuristic\:\") +- call VerifyScreenDump(buf, 'Test_diff_11', {}, 'three') +- +- " Test 12: diff the same file +- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) +- call VerifyBoth(buf, 'Test_diff_12', '') +- +- " Test 13: diff an empty file +- call WriteDiffFiles(buf, [], []) +- call VerifyBoth(buf, 'Test_diff_13', '') +- +- " Test 14: test diffopt+=icase +- call WriteDiffFiles(buf, ['a', 'b', 'cd'], ['A', 'b', 'cDe']) +- call VerifyBoth(buf, 'Test_diff_14', " diffopt+=filler diffopt+=icase") +- +- " Test 15-16: test diffopt+=iwhite +- call WriteDiffFiles(buf, ['int main()', '{', ' printf("Hello, World!");', ' return 0;', '}'], +- \ ['int main()', '{', ' if (0)', ' {', ' printf("Hello, World!");', ' return 0;', ' }', '}']) +- call term_sendkeys(buf, ":diffupdate!\") +- call term_sendkeys(buf, ":set diffopt&vim diffopt+=filler diffopt+=iwhite\") +- call VerifyScreenDump(buf, 'Test_diff_15', {}) +- call term_sendkeys(buf, ":set diffopt+=internal\") +- call VerifyScreenDump(buf, 'Test_diff_16', {}) +- +- " Test 17: test diffopt+=iblank +- call WriteDiffFiles(buf, ['a', ' ', 'cd', 'ef', 'xxx'], ['a', 'cd', '', 'ef', 'yyy']) +- call VerifyInternal(buf, 'Test_diff_17', " diffopt+=iblank") +- +- " Test 18: test diffopt+=iblank,iwhite / iwhiteall / iwhiteeol +- call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhite") +- call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteall") +- call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteeol") +- +- " Test 19: test diffopt+=iwhiteeol +- call WriteDiffFiles(buf, ['a ', 'x', 'cd', 'ef', 'xx xx', 'foo', 'bar'], ['a', 'x', 'c d', ' ef', 'xx xx', 'foo', '', 'bar']) +- call VerifyInternal(buf, 'Test_diff_19', " diffopt+=iwhiteeol") +- +- " Test 19: test diffopt+=iwhiteall +- call VerifyInternal(buf, 'Test_diff_20', " diffopt+=iwhiteall") +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('Xfile1') +- call delete('Xfile2') +-endfunc +- +-func Test_diff_with_cursorline() +- CheckScreendump +- +- call writefile([ +- \ 'hi CursorLine ctermbg=red ctermfg=white', +- \ 'set cursorline', +- \ 'call setline(1, ["foo","foo","foo","bar"])', +- \ 'vnew', +- \ 'call setline(1, ["bee","foo","foo","baz"])', +- \ 'windo diffthis', +- \ '2wincmd w', +- \ ], 'Xtest_diff_cursorline') +- let buf = RunVimInTerminal('-S Xtest_diff_cursorline', {}) +- +- call VerifyScreenDump(buf, 'Test_diff_with_cursorline_01', {}) +- call term_sendkeys(buf, "j") +- call VerifyScreenDump(buf, 'Test_diff_with_cursorline_02', {}) +- call term_sendkeys(buf, "j") +- call VerifyScreenDump(buf, 'Test_diff_with_cursorline_03', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('Xtest_diff_cursorline') +-endfunc +- + func Test_diff_with_syntax() + CheckScreendump + +@@ -942,30 +785,6 @@ func Test_diff_with_syntax() + call delete('Xprogram2.c') + endfunc + +-func Test_diff_of_diff() +- CheckScreendump +- CheckFeature rightleft +- +- call writefile([ +- \ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])', +- \ 'vnew', +- \ 'call setline(1, ["aa","bb","cc"])', +- \ 'windo diffthis', +- \ '1wincmd w', +- \ 'setlocal number', +- \ ], 'Xtest_diff_diff') +- let buf = RunVimInTerminal('-S Xtest_diff_diff', {}) +- +- call VerifyScreenDump(buf, 'Test_diff_of_diff_01', {}) +- +- call term_sendkeys(buf, ":set rightleft\") +- call VerifyScreenDump(buf, 'Test_diff_of_diff_02', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('Xtest_diff_diff') +-endfunc +- + func CloseoffSetup() + enew + call setline(1, ['one', 'two', 'three']) +diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim +index 31357e7..15cd11a 100644 +--- a/src/testdir/test_filetype.vim ++++ b/src/testdir/test_filetype.vim +@@ -538,15 +538,6 @@ func CheckItems(checks) + endfor + endfunc + +-func Test_filetype_detection() +- filetype on +- call CheckItems(s:filename_checks) +- if has('fname_case') +- call CheckItems(s:filename_case_checks) +- endif +- filetype off +-endfunc +- + " Filetypes detected from the file contents by scripts.vim + let s:script_checks = { + \ 'virata': [['% Virata'], +diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim +index d5ee716..43e6028 100644 +--- a/src/testdir/test_popupwin.vim ++++ b/src/testdir/test_popupwin.vim +@@ -519,122 +519,6 @@ func Test_popup_noscrolloff() + call popup_close(winid) + endfunc + +-func Test_popup_drag() +- CheckScreendump +- +- " create a popup that covers the command line +- let lines =<< trim END +- call setline(1, range(1, 20)) +- split +- vsplit +- $wincmd w +- vsplit +- 1wincmd w +- let winid = popup_create(['1111', '222222', '33333'], #{ +- \ drag: 1, +- \ resize: 1, +- \ border: [], +- \ line: &lines - 4, +- \ }) +- func Dragit() +- call feedkeys("\\\\\", "xt") +- endfunc +- map :call test_setmouse(&lines - 4, &columns / 2) +- map :call test_setmouse(&lines - 8, &columns / 2 - 20) +- func Resize() +- call feedkeys("\\\\\", "xt") +- endfunc +- map :call test_setmouse(6, 21) +- map :call test_setmouse(7, 25) +- END +- call writefile(lines, 'XtestPopupDrag') +- let buf = RunVimInTerminal('-S XtestPopupDrag', #{rows: 10}) +- call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {}) +- +- call term_sendkeys(buf, ":call Dragit()\") +- call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {}) +- +- call term_sendkeys(buf, ":call Resize()\") +- call VerifyScreenDump(buf, 'Test_popupwin_drag_03', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestPopupDrag') +-endfunc +- +-func Test_popup_close_with_mouse() +- CheckScreendump +- +- let lines =<< trim END +- call setline(1, range(1, 20)) +- " With border, can click on X +- let winid = popup_create('foobar', #{ +- \ close: 'button', +- \ border: [], +- \ line: 1, +- \ col: 1, +- \ }) +- func CloseMsg(id, result) +- echomsg 'Popup closed with ' .. a:result +- endfunc +- let winid = popup_create('notification', #{ +- \ close: 'click', +- \ line: 3, +- \ col: 15, +- \ callback: 'CloseMsg', +- \ }) +- let winid = popup_create('no border here', #{ +- \ close: 'button', +- \ line: 5, +- \ col: 3, +- \ }) +- let winid = popup_create('only padding', #{ +- \ close: 'button', +- \ padding: [], +- \ line: 5, +- \ col: 23, +- \ }) +- func CloseWithX() +- call feedkeys("\\\", "xt") +- endfunc +- map :call test_setmouse(1, len('foobar') + 2) +- func CloseWithClick() +- call feedkeys("\\\", "xt") +- endfunc +- map :call test_setmouse(3, 17) +- func CreateWithMenuFilter() +- let winid = popup_create('barfoo', #{ +- \ close: 'button', +- \ filter: 'popup_filter_menu', +- \ border: [], +- \ line: 1, +- \ col: 40, +- \ }) +- endfunc +- END +- call writefile(lines, 'XtestPopupClose') +- let buf = RunVimInTerminal('-S XtestPopupClose', #{rows: 10}) +- call VerifyScreenDump(buf, 'Test_popupwin_close_01', {}) +- +- call term_sendkeys(buf, ":call CloseWithX()\") +- call VerifyScreenDump(buf, 'Test_popupwin_close_02', {}) +- +- call term_sendkeys(buf, ":call CloseWithClick()\") +- call VerifyScreenDump(buf, 'Test_popupwin_close_03', {}) +- +- call term_sendkeys(buf, ":call CreateWithMenuFilter()\") +- call VerifyScreenDump(buf, 'Test_popupwin_close_04', {}) +- +- " We have to send the actual mouse code, feedkeys() would be caught the +- " filter. +- call term_sendkeys(buf, "\[<0;47;1M") +- call VerifyScreenDump(buf, 'Test_popupwin_close_05', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestPopupClose') +-endfunction +- + func Test_popup_menu_wrap() + CheckScreendump + +@@ -1335,52 +1219,6 @@ func Test_popup_atcursor_pos() + call delete('XtestPopupAtcursorPos') + endfunc + +-func Test_popup_beval() +- CheckScreendump +- CheckFeature balloon_eval_term +- +- let lines =<< trim END +- call setline(1, range(1, 20)) +- call setline(5, 'here is some text to hover over') +- set balloonevalterm +- set balloonexpr=BalloonExpr() +- set balloondelay=100 +- func BalloonExpr() +- let s:winid = [v:beval_text]->popup_beval({}) +- return '' +- endfunc +- func Hover() +- call test_setmouse(5, 15) +- call feedkeys("\\", "xt") +- sleep 100m +- endfunc +- func MoveOntoPopup() +- call test_setmouse(4, 17) +- call feedkeys("\\\", "xt") +- endfunc +- func MoveAway() +- call test_setmouse(5, 13) +- call feedkeys("\\\", "xt") +- endfunc +- END +- call writefile(lines, 'XtestPopupBeval') +- let buf = RunVimInTerminal('-S XtestPopupBeval', #{rows: 10}) +- call term_wait(buf, 100) +- call term_sendkeys(buf, 'j') +- call term_sendkeys(buf, ":call Hover()\") +- call VerifyScreenDump(buf, 'Test_popupwin_beval_1', {}) +- +- call term_sendkeys(buf, ":call MoveOntoPopup()\") +- call VerifyScreenDump(buf, 'Test_popupwin_beval_2', {}) +- +- call term_sendkeys(buf, ":call MoveAway()\") +- call VerifyScreenDump(buf, 'Test_popupwin_beval_3', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestPopupBeval') +-endfunc +- + func Test_popup_filter() + new + call setline(1, 'some text') +@@ -1895,129 +1733,6 @@ func Test_notifications() + call delete('XtestNotifications') + endfunc + +-func Test_popup_scrollbar() +- CheckScreendump +- +- let lines =<< trim END +- call setline(1, range(1, 20)) +- hi ScrollThumb ctermbg=blue +- hi ScrollBar ctermbg=red +- let winid = popup_create(['one', 'two', 'three', 'four', 'five', +- \ 'six', 'seven', 'eight', 'nine'], #{ +- \ minwidth: 8, +- \ maxheight: 4, +- \ }) +- func ScrollUp() +- call feedkeys("\\", "xt") +- endfunc +- func ScrollDown() +- call feedkeys("\\", "xt") +- endfunc +- func ClickTop() +- call feedkeys("\\", "xt") +- endfunc +- func ClickBot() +- call popup_setoptions(g:winid, #{border: [], close: 'button'}) +- call feedkeys("\\", "xt") +- endfunc +- func Popup_filter(winid, key) +- if a:key == 'j' +- let line = popup_getoptions(a:winid).firstline +- let nlines = line('$', a:winid) +- let newline = line < nlines ? (line + 1) : nlines +- call popup_setoptions(a:winid, #{firstline: newline}) +- return v:true +- elseif a:key == 'x' +- call popup_close(a:winid) +- return v:true +- endif +- endfunc +- +- func PopupScroll() +- call popup_clear() +- let text =<< trim END +- 1 +- 2 +- 3 +- 4 +- long line long line long line long line long line long line +- long line long line long line long line long line long line +- long line long line long line long line long line long line +- END +- call popup_create(text, #{ +- \ minwidth: 30, +- \ maxwidth: 30, +- \ minheight: 4, +- \ maxheight: 4, +- \ firstline: 1, +- \ lastline: 4, +- \ wrap: v:true, +- \ scrollbar: v:true, +- \ mapping: v:false, +- \ filter: funcref('Popup_filter') +- \ }) +- endfunc +- map :call test_setmouse(5, 36) +- map :call test_setmouse(4, 42) +- map :call test_setmouse(7, 42) +- END +- call writefile(lines, 'XtestPopupScroll') +- let buf = RunVimInTerminal('-S XtestPopupScroll', #{rows: 10}) +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_1', {}) +- +- call term_sendkeys(buf, ":call popup_setoptions(winid, #{firstline: 2})\") +- call term_sendkeys(buf, ":\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_2', {}) +- +- call term_sendkeys(buf, ":call popup_setoptions(winid, #{firstline: 6})\") +- call term_sendkeys(buf, ":\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_3', {}) +- +- call term_sendkeys(buf, ":call popup_setoptions(winid, #{firstline: 9})\") +- call term_sendkeys(buf, ":\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_4', {}) +- +- call term_sendkeys(buf, ":call popup_setoptions(winid, #{scrollbarhighlight: 'ScrollBar', thumbhighlight: 'ScrollThumb', firstline: 5})\") +- " this scrolls two lines (half the window height) +- call term_sendkeys(buf, ":call ScrollUp()\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_5', {}) +- +- call term_sendkeys(buf, ":call ScrollDown()\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_6', {}) +- +- call term_sendkeys(buf, ":call ScrollDown()\") +- " wait a bit, otherwise it fails sometimes (double click recognized?) +- sleep 100m +- call term_sendkeys(buf, ":call ScrollDown()\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_7', {}) +- +- call term_sendkeys(buf, ":call ClickTop()\") +- sleep 100m +- call term_sendkeys(buf, ":call ClickTop()\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_8', {}) +- +- call term_sendkeys(buf, ":call ClickBot()\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_9', {}) +- +- " remove the minwidth and maxheight +- call term_sendkeys(buf, ":call popup_setoptions(winid, #{maxheight: 0, minwidth: 0})\") +- call term_sendkeys(buf, ":\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_10', {}) +- +- " check size with non-wrapping lines +- call term_sendkeys(buf, ":call PopupScroll()\") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_11', {}) +- +- " check size with wrapping lines +- call term_sendkeys(buf, "j") +- call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {}) +- call term_sendkeys(buf, "x") +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestPopupScroll') +-endfunc +- + func Test_popup_fitting_scrollbar() + " this was causing a crash, divide by zero + let winid = popup_create([ +diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim +index 1b339d4..a42129d 100644 +--- a/src/testdir/test_popupwin_textprop.vim ++++ b/src/testdir/test_popupwin_textprop.vim +@@ -7,170 +7,4 @@ CheckFeature textprop + source screendump.vim + CheckScreendump + +-func Test_textprop_popup() +- let lines =<< trim END +- call setline(1, range(1, 100)) +- call setline(50, 'some text to work with') +- 50 +- normal zz +- set scrolloff=0 +- call prop_type_add('popupMarker', #{highlight: 'DiffAdd', bufnr: bufnr('%')}) +- call prop_add(50, 11, #{ +- \ length: 7, +- \ type: 'popupMarker', +- \ bufnr: bufnr('%'), +- \ }) +- let winid = popup_create('the text', #{ +- \ pos: 'botleft', +- \ textprop: 'popupMarker', +- \ border: [], +- \ padding: [0,1,0,1], +- \ close: 'click', +- \ }) +- END +- call writefile(lines, 'XtestTextpropPopup') +- let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10}) +- call VerifyScreenDump(buf, 'Test_popup_textprop_01', {}) +- +- call term_sendkeys(buf, "zt") +- call VerifyScreenDump(buf, 'Test_popup_textprop_02', {}) +- +- call term_sendkeys(buf, "zzIawe\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_03', {}) +- +- call term_sendkeys(buf, "0dw") +- call VerifyScreenDump(buf, 'Test_popup_textprop_04', {}) +- +- call term_sendkeys(buf, "Oinserted\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_05', {}) +- +- call term_sendkeys(buf, "k2dd") +- call VerifyScreenDump(buf, 'Test_popup_textprop_06', {}) +- +- call term_sendkeys(buf, "4\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_07', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestTextpropPopup') +-endfunc +- +-func Test_textprop_popup_corners() +- let lines =<< trim END +- call setline(1, range(1, 100)) +- call setline(50, 'now working with some longer text here') +- 50 +- normal zz +- set scrolloff=0 +- call prop_type_add('popupMarker', #{highlight: 'DiffAdd'}) +- call prop_add(50, 23, #{ +- \ length: 6, +- \ type: 'popupMarker', +- \ }) +- let winid = popup_create('bottom left', #{ +- \ pos: 'botleft', +- \ textprop: 'popupMarker', +- \ textpropwin: win_getid(), +- \ padding: [0,1,0,1], +- \ }) +- let winid = popup_create('bottom right', #{ +- \ pos: 'botright', +- \ textprop: 'popupMarker', +- \ border: [], +- \ padding: [0,1,0,1], +- \ }) +- let winid = popup_create('top left', #{ +- \ pos: 'topleft', +- \ textprop: 'popupMarker', +- \ border: [], +- \ padding: [0,1,0,1], +- \ }) +- let winid = popup_create('top right', #{ +- \ pos: 'topright', +- \ textprop: 'popupMarker', +- \ padding: [0,1,0,1], +- \ }) +- END +- call writefile(lines, 'XtestTextpropPopupCorners') +- let buf = RunVimInTerminal('-S XtestTextpropPopupCorners', #{rows: 12}) +- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_1', {}) +- +- call term_sendkeys(buf, "0dw") +- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_2', {}) +- +- call term_sendkeys(buf, "46Goextra\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_3', {}) +- +- call term_sendkeys(buf, "u") +- call term_sendkeys(buf, ":\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_4', {}) +- +- call term_sendkeys(buf, ":vsplit foo\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_5', {}) +- +- call term_sendkeys(buf, ":only!\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_6', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestTextpropPopupCorners') +-endfunc +- +-func Test_textprop_popup_offsets() +- let lines =<< trim END +- call setline(1, range(1, 100)) +- call setline(50, 'now working with some longer text here') +- 50 +- normal zz +- set scrolloff=0 +- call prop_type_add('popupMarker', #{highlight: 'DiffAdd'}) +- call prop_add(50, 23, #{ +- \ length: 6, +- \ type: 'popupMarker', +- \ }) +- let winid = popup_create('bottom left', #{ +- \ pos: 'botleft', +- \ line: -1, +- \ col: 2, +- \ textprop: 'popupMarker', +- \ padding: [0,1,0,1], +- \ }) +- let winid = popup_create('bottom right', #{ +- \ pos: 'botright', +- \ line: -1, +- \ col: -2, +- \ textprop: 'popupMarker', +- \ border: [], +- \ padding: [0,1,0,1], +- \ }) +- let winid = popup_create('top left', #{ +- \ pos: 'topleft', +- \ line: 1, +- \ col: 2, +- \ textprop: 'popupMarker', +- \ border: [], +- \ padding: [0,1,0,1], +- \ }) +- let winid = popup_create('top right', #{ +- \ pos: 'topright', +- \ line: 1, +- \ col: -2, +- \ textprop: 'popupMarker', +- \ padding: [0,1,0,1], +- \ }) +- END +- call writefile(lines, 'XtestTextpropPopupOffset') +- let buf = RunVimInTerminal('-S XtestTextpropPopupOffset', #{rows: 12}) +- call VerifyScreenDump(buf, 'Test_popup_textprop_off_1', {}) +- +- " test that removing the text property closes the popups +- call term_sendkeys(buf, ":call prop_clear(50)\") +- call VerifyScreenDump(buf, 'Test_popup_textprop_off_2', {}) +- +- " clean up +- call StopVimInTerminal(buf) +- call delete('XtestTextpropPopupOffset') +-endfunc +- +- + " vim: shiftwidth=2 sts=2 +-- +2.19.1 + diff --git a/vim.spec b/vim.spec index 917b6048be28bcbaf0228d2721fc9089302fba62..8249d569464a8591e4c167edca2dea5b076b25b6 100644 --- a/vim.spec +++ b/vim.spec @@ -12,7 +12,7 @@ Name: vim Epoch: 2 Version: 8.2 -Release: 62 +Release: 63 Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text. License: Vim and MIT URL: http://www.vim.org @@ -169,12 +169,20 @@ Patch6132: backport-CVE-2022-2946.patch Patch6133: backport-CVE-2022-2980.patch Patch6134: backport-patch-8.2.1677-memory-access-errors-when-calling-set.patch Patch6135: backport-CVE-2022-3016.patch +Patch6136: backport-patch-8.2.0243-insufficient-code-coverage-for-ex_doc.patch +Patch6137: backport-patch-8.2.4152-block-insert-with-double-wide-character-fails.patch +Patch6139: backport-patch-8.2.0892-ubsan-warns-for-undefined-behavior.patch +Patch6140: backport-patch-8.2.3110-pattern-that-matches-the-cursor-posit.patch Patch9000: bugfix-rm-modify-info-version.patch +Patch9001: openEuler-remove-failed-tests-due-to-patch.patch +Patch9002: openEuler-adapt-test87-failed.patch + +Patch6138: backport-patch-8.2.0945-cannot-use-z-when-spell-is-off.patch BuildRequires: autoconf python3-devel ncurses-devel gettext perl-devel perl-generators gcc BuildRequires: perl(ExtUtils::Embed) perl(ExtUtils::ParseXS) libacl-devel gpm-devel file -BuildRequires: desktop-file-utils >= 0.2.93 +BuildRequires: desktop-file-utils >= 0.2.93 libtool %if %{_with_selinux__} BuildRequires: libselinux-devel %endif @@ -453,7 +461,6 @@ echo ".so man1/vi.1" > %{buildroot}%{_mandir}/man5/virc.5 touch %{buildroot}%{_datadir}/%{name}/vimfiles/doc/tags pushd runtime -rm -rf doc ln -sf ../../%{name}/%{vimdir}/doc docs popd @@ -464,6 +471,9 @@ popd > %{_datadir}/%{name}/vimfiles/doc/tags || : %{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || : +%check +LC_ALL=en_US.UTF-8 make -j1 test + %files common %exclude %{_datadir}/vim/%{vimdir}/macros/maze/maze*.c %exclude %{_datadir}/vim/%{vimdir}/tools @@ -557,6 +567,12 @@ popd %{_mandir}/man1/evim.* %changelog +* Wed Aug 31 2022 wangjiang - 2:8.2-63 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:enable check + * Mon Aug 29 2022 shixuantong - 2:8.2-62 - Type:CVE - ID:CVE-2022-3016