Skip to content

Commit 41c873e

Browse files
committed
Perform checks before local resolution
1 parent 07271a1 commit 41c873e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugin/vim-npr.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ let g:vim_npr_file_types = ["js", "jsx", "css", "coffee"]
1616
let g:vim_npr_default_dirs = ["src", "lib", "test", "public", "node_modules"]
1717

1818
function! VimNPRFindFile(cmd) abort
19+
if index(g:vim_npr_file_types, expand("%:e")) == -1
20+
return s:print_error("(Error) VimNPR: incorrect file type for to perform resolution within. Please raise an issue at github.com/tomarrell/vim-npr.") " Don't run on filetypes that we don't support
21+
endif
22+
1923
" Get file path pattern under cursor
2024
let l:cfile = expand("<cfile>")
2125

@@ -28,10 +32,6 @@ function! VimNPRFindFile(cmd) abort
2832
endif
2933
endfor
3034

31-
if index(g:vim_npr_file_types, expand("%:e")) == -1
32-
return s:print_error("(Error) VimNPR: incorrect file type for to perform resolution within.") " Don't run on filetypes that we don't support
33-
endif
34-
3535
let l:foundPackage = 0
3636
let l:levels = 0
3737

0 commit comments

Comments
 (0)