From be552c8340615a4c9e670bc77df5e6016214d4f4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 16 Aug 2018 11:03:12 -0400 Subject: vim-patch:8.0.1231: expanding file name drops dash Problem: Expanding file name drops dash. (stucki) Solution: Use the right position. (Christian Brabandt, closes vim/vim#2184) https://github.com/vim/vim/commit/c312b8b87a589ed8452dbf0f555f05ff86d04692 --- src/nvim/testdir/test_cmdline.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index a93beac4ad..ac80dd383e 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -380,6 +380,27 @@ func Test_cmdline_complete_user_cmd() delcommand Foo endfunc +func Test_cmdline_write_alternatefile() + new + call setline('.', ['one', 'two']) + f foo.txt + new + f #-A + call assert_equal('foo.txt-A', expand('%')) + f #<-B.txt + call assert_equal('foo-B.txt', expand('%')) + f %< + call assert_equal('foo-B', expand('%')) + new + call assert_fails('f #<', 'E95') + bw! + f foo-B.txt + f %<-A + call assert_equal('foo-B-A', expand('%')) + bw! + bw! +endfunc + " using a leading backslash here set cpo+=C -- cgit