From c4c29696245b9ef03935335f464dbaa2b46c2ba5 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Sat, 10 Sep 2016 23:11:05 +0800 Subject: vim-patch:7.4.1533 #5320 Problem: Using feedkeys() with an empty string disregards 'x' option. Solution: Make 'x' work with an empty string. (Thinca) When integrating the patch to nvim, used same logic but different code based on nvim codebase. New test passed. https://github.com/vim/vim/commit/74c5bbf13435a7ab1e3461078bbcb1200f0451e1 --- src/nvim/testdir/test_alot.vim | 1 + src/nvim/testdir/test_feedkeys.vim | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/nvim/testdir/test_feedkeys.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index daf6f026ba..e5214971b4 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -3,6 +3,7 @@ source test_assign.vim source test_cursor_func.vim +source test_feedkeys.vim source test_cmdline.vim source test_menu.vim source test_popup.vim diff --git a/src/nvim/testdir/test_feedkeys.vim b/src/nvim/testdir/test_feedkeys.vim new file mode 100644 index 0000000000..33cd58949d --- /dev/null +++ b/src/nvim/testdir/test_feedkeys.vim @@ -0,0 +1,10 @@ +" Test feedkeys() function. + +func Test_feedkeys_x_with_empty_string() + new + call feedkeys("ifoo\") + call assert_equal('', getline('.')) + call feedkeys('', 'x') + call assert_equal('foo', getline('.')) + quit! +endfunc -- cgit