patch 9.1.1135: 'suffixesadd' doesn't work with multiple items
Problem: 'suffixesadd' doesn't work with multiple items
(after 9.1.1122).
Solution: Don't concat multiple suffixes together.
(zeertzjq)
fixes: #16694
closes: #16699
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_gf.vim b/src/testdir/test_gf.vim
index cc12b36..4dc01c9 100644
--- a/src/testdir/test_gf.vim
+++ b/src/testdir/test_gf.vim
@@ -353,4 +353,36 @@
%bw!
endfunc
+func Test_gf_with_suffixesadd()
+ let cwd = getcwd()
+ let dir = 'Xtestgf_sua_dir'
+ call mkdir(dir, 'R')
+ call chdir(dir)
+
+ call writefile([], 'foo.c', 'D')
+ call writefile([], 'bar.cpp', 'D')
+ call writefile([], 'baz.cc', 'D')
+ call writefile([], 'foo.o', 'D')
+ call writefile([], 'bar.o', 'D')
+ call writefile([], 'baz.o', 'D')
+
+ new
+ setlocal path=,, suffixesadd=.c,.cpp
+ call setline(1, ['./foo', './bar', './baz'])
+ exe "normal! gg\<C-W>f"
+ call assert_equal('foo.c', expand('%:t'))
+ close
+ exe "normal! 2gg\<C-W>f"
+ call assert_equal('bar.cpp', expand('%:t'))
+ close
+ call assert_fails('exe "normal! 3gg\<C-W>f"', 'E447:')
+ setlocal suffixesadd+=.cc
+ exe "normal! 3gg\<C-W>f"
+ call assert_equal('baz.cc', expand('%:t'))
+ close
+
+ %bwipe!
+ call chdir(cwd)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab