From 9ea449085da08eaa5ccb826dd5e37f480c871e79 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 24 Jul 2019 20:38:36 -0400 Subject: vim-patch:8.1.1746: ":dl" is seen as ":dlist" instead of ":delete" Problem: ":dl" is seen as ":dlist" instead of ":delete". Solution: Do not use cmdidxs2[] if the length is 1. (closes vim/vim#4721) https://github.com/vim/vim/commit/94f82cbacf76767b5ac32f813e1d670501dbd0e6 --- src/nvim/testdir/test_excmd.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/nvim/testdir/test_excmd.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim new file mode 100644 index 0000000000..f5ce979208 --- /dev/null +++ b/src/nvim/testdir/test_excmd.vim @@ -0,0 +1,10 @@ +" Tests for various Ex commands. + +func Test_ex_delete() + new + call setline(1, ['a', 'b', 'c']) + 2 + " :dl is :delete with the "l" flag, not :dlist + .dl + call assert_equal(['a', 'c'], getline(1, 2)) +endfunc -- cgit From a77e5b3606bd40e524e5e3ab428b58ca2b3f0ac2 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 25 Jul 2019 01:41:42 -0400 Subject: vim-patch:8.1.0905: complicated regexp causes a crash Problem: Complicated regexp causes a crash. (Kuang-che Wu) Solution: Limit the recursiveness of addstate(). (closes vim/vim#3941) https://github.com/vim/vim/commit/5567ad48b66dff13670af52a48509059acc34dfe --- src/nvim/testdir/test_regexp_latin.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim index de209fa9ec..5fb6e78baa 100644 --- a/src/nvim/testdir/test_regexp_latin.vim +++ b/src/nvim/testdir/test_regexp_latin.vim @@ -85,3 +85,9 @@ func Test_multi_failure() call assert_fails('/a\{a}', 'E870:') set re=0 endfunc + +func Test_recursive_addstate() + " This will call addstate() recursively until it runs into the limit. + let lnum = search('\v((){328}){389}') + call assert_equal(0, lnum) +endfunc -- cgit From 52488ea6fbda4db821e8bad305241504d7fda1c0 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 25 Jul 2019 02:22:02 -0400 Subject: vim-patch:8.1.0910: crash with tricky search pattern Problem: Crash with tricky search pattern. (Kuang-che Wu) Solution: Check for runnning out of memory. (closes vim/vim#3950) https://github.com/vim/vim/commit/15bbd6ec871a0efdd16256e1fccbaac0fd374cbd --- src/nvim/testdir/test_regexp_latin.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim index 5fb6e78baa..b5e99b0ed3 100644 --- a/src/nvim/testdir/test_regexp_latin.vim +++ b/src/nvim/testdir/test_regexp_latin.vim @@ -91,3 +91,10 @@ func Test_recursive_addstate() let lnum = search('\v((){328}){389}') call assert_equal(0, lnum) endfunc + +func Test_out_of_memory() + new + s/^/,n + " This will be slow... + call assert_fails('call search("\\v((n||<)+);")', 'E363:') +endfunc -- cgit