From 05b8bbc938bdeac4a5ee2d3ae5cf7a7f05e822d3 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 1 Jan 2021 22:30:41 +0100 Subject: Fix loading for vim 8 packages, closes #613 --- scripts/build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build b/scripts/build index 0ffa2039..23bfb33c 100755 --- a/scripts/build +++ b/scripts/build @@ -7,6 +7,9 @@ require 'fileutils' require 'set' require 'json' require 'tsort' +require 'pathname' + +BASE_DIR = Pathname.new(File.expand_path('../..', __FILE__)) Dir.chdir(File.dirname(__dir__)) @@ -48,7 +51,7 @@ def verify(packages, heuristics) extensions = packages.flat_map { |e| e["filetypes"] || [] } .flat_map { |e| e["extensions"].map { |e| "*." + e } } native_filetypes = detect_filetypes_str( - File.read('ftdetect/polyglot.vim').match(/" DO NOT EDIT CODE ABOVE.*/m)[0] + File.read('autoload/polyglot/init.vim').match(/" DO NOT EDIT CODE ABOVE.*/m)[0] ).flat_map { |e| expand_all(e) } for e in (native_filetypes & extensions) @@ -295,7 +298,7 @@ def copy_file(name, src, dest) open(dest, "w") do |output| if dest.match?(/\.vim$/) output << <<~EOF - if has_key(g:polyglot_is_disabled, '#{name}') + if polyglot#init#is_disabled(expand(':p'), '#{name}', '#{dest}') finish endif @@ -688,7 +691,7 @@ def generate_ftdetect(packages, heuristics) show_warnings(all_filetypes, expected_filetypes) - inject_code('ftdetect/polyglot.vim', output) + inject_code('autoload/polyglot/init.vim', output) output = [] -- cgit v1.2.3