aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_gf.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_gf.vim')
-rw-r--r--src/nvim/testdir/test_gf.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_gf.vim b/src/nvim/testdir/test_gf.vim
index 51e1a06390..1569177d66 100644
--- a/src/nvim/testdir/test_gf.vim
+++ b/src/nvim/testdir/test_gf.vim
@@ -35,6 +35,13 @@ func Test_gf_url()
call search("URL")
call assert_equal("URL://machine.name:1234?q=vim", expand("<cfile>"))
+ %d
+ call setline(1, "demo://remote_file")
+ wincmd f
+ call assert_equal('demo://remote_file', @%)
+ call assert_equal(2, winnr('$'))
+ close!
+
set isf&vim
enew!
endfunc
@@ -170,4 +177,21 @@ func Test_gf_error()
bwipe!
endfunc
+" If a file is not found by 'gf', then 'includeexpr' should be used to locate
+" the file.
+func Test_gf_includeexpr()
+ new
+ let g:Inc_fname = ''
+ func IncFunc()
+ let g:Inc_fname = v:fname
+ return v:fname
+ endfunc
+ setlocal includeexpr=IncFunc()
+ call setline(1, 'somefile.java')
+ call assert_fails('normal gf', 'E447:')
+ call assert_equal('somefile.java', g:Inc_fname)
+ close!
+ delfunc IncFunc
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab