# HG changeset patch # User Bram Moolenaar # Date 1573246804 -3600 # Node ID 17ec36265fcbdd4652a0a256534b35c291e21aa7 # Parent 3f04b0a32e7f5e9abb4cbd1c29fb00be13c5400d patch 8.1.2270: "gf" is not tested in Visual mode Commit: https://github.com/vim/vim/commit/0208b6b771161d1a668b3568f71dc2bde3614933 Author: Bram Moolenaar Date: Fri Nov 8 21:49:48 2019 +0100 patch 8.1.2270: "gf" is not tested in Visual mode Problem: "gf" is not tested in Visual mode. Solution: Add Visual mode test and test errors. (Dominique Pelle, closes #5197) diff --git a/src/testdir/test_gf.vim b/src/testdir/test_gf.vim --- a/src/testdir/test_gf.vim +++ b/src/testdir/test_gf.vim @@ -99,3 +99,28 @@ func Test_gf() call delete('Xtest1') call delete('Xtestgf') endfunc + +func Test_gf_visual() + call writefile([], "Xtest_gf_visual") + new + call setline(1, 'XXXtest_gf_visualXXX') + set hidden + + " Visually select Xtest_gf_visual and use gf to go to that file + norm! ttvtXgf + call assert_equal('Xtest_gf_visual', bufname('%')) + + bwipe! + call delete('Xtest_gf_visual') + set hidden& +endfunc + +func Test_gf_error() + new + call assert_fails('normal gf', 'E446:') + call assert_fails('normal gF', 'E446:') + call setline(1, '/doesnotexist') + call assert_fails('normal gf', 'E447:') + call assert_fails('normal gF', 'E447:') + bwipe! +endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2270, +/**/ 2269, /**/ 2268,