Skip to content

Commit 1641c4b

Browse files
committed
s:projectionist_detect: only handle .vim files
This avoids sourcing the autoload file for `scriptease#locate` when not editing Vim files. The projectionist setup gets also done for `doc/*.txt`, which gets skipped now. This could be changed/enhanced if needed.
1 parent 9dc2518 commit 1641c4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugin/scriptease.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ augroup END
113113
" Section: Projectionist
114114

115115
function! s:projectionist_detect() abort
116-
let file = get(g:, 'projectionist_file', '')
116+
let file = g:projectionist_file
117+
if fnamemodify(file, ':e') !=# 'vim'
118+
" Only handle .vim files (avoids sourcing the autoload file).
119+
return
120+
endif
117121
let path = substitute(scriptease#locate(file)[0], '[\/]after$', '', '')
118122
if !empty(path)
119123
let reload = ":Runtime ./{open}autoload,plugin{close}/**/*.vim"

0 commit comments

Comments
 (0)