From f95026252c5a31242903a98c741887696dfbb11f Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 27 Sep 2019 19:47:32 +0200 Subject: Update everything, closes #435 --- autoload/crystal_lang.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'autoload/crystal_lang.vim') 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 : ]) \ ] -- cgit v1.2.3