diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-27 19:47:32 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-27 19:47:32 +0200 |
commit | f95026252c5a31242903a98c741887696dfbb11f (patch) | |
tree | cd697cdc96c20a44f03ff3aacc67f78fdcc6ece5 /autoload/crystal_lang.vim | |
parent | 4f3df59be709bf0d5c5c67dc804fde49abdc2700 (diff) | |
download | vim-polyglot-f95026252c5a31242903a98c741887696dfbb11f.tar.gz vim-polyglot-f95026252c5a31242903a98c741887696dfbb11f.zip |
Update everything, closes #435
Diffstat (limited to 'autoload/crystal_lang.vim')
-rw-r--r-- | autoload/crystal_lang.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/autoload/crystal_lang.vim b/autoload/crystal_lang.vim index a04d456b..99d0ca2c 100644 --- a/autoload/crystal_lang.vim +++ b/autoload/crystal_lang.vim @@ -77,10 +77,17 @@ function! crystal_lang#entrypoint_for(file_path) abort return a:file_path endif + let required_spec_path = get(b:, 'crystal_required_spec_path', get(g:, 'crystal_required_spec_path', '')) + if required_spec_path !=# '' + let require_spec_str = './' . required_spec_path + else + let require_spec_str = './spec/**' + endif + let temp_name = root_dir . '/__vim-crystal-temporary-entrypoint-' . fnamemodify(a:file_path, ':t') let contents = [ \ 'require "spec"', - \ 'require "./spec/**"', + \ 'require "' . require_spec_str . '"', \ printf('require "./%s"', fnamemodify(a:file_path, ':p')[strlen(root_dir)+1 : ]) \ ] |