From 2f133372bc19259888036c659cc618299ae5df59 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 29 Sep 2020 19:51:43 +0200 Subject: Make loading faster for ambiguous extensions --- scripts/build | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build b/scripts/build index 14141aa3..2e767b9b 100755 --- a/scripts/build +++ b/scripts/build @@ -502,32 +502,6 @@ def generate_ftdetect(packages, heuristics) native_extensions = Set.new(native_filetypes.flat_map { |f| f["extensions"] || [] }) native_filenames = Set.new(native_filetypes.flat_map { |f| f["filenames"] || [] }) - for package in packages - name = package.fetch("name") - - to_disable = [] - - for filetype in package["filetypes"] - for extension in filetype["extensions"] - if native_extensions.include?(extension) - to_disable << "*." + extension - end - end - - for filename in filetype["filenames"] - if native_filenames.include?(filename) - to_disable << filename - end - end - end - - if to_disable.size > 0 - output << "if !has_key(s:disabled_packages, '#{name}')\n" - output << " au! BufRead,BufNewFile #{to_disable.join(",")}\n" - output << "endif\n\n" - end - end - for package in packages filetypes = package["filetypes"] or raise "Unknown filetype for: #{package["name"]}" @@ -580,7 +554,7 @@ def generate_ftdetect(packages, heuristics) end if set_globs.size > 0 - autocommands << " au BufNewFile,BufRead #{set_globs.join(",")} #{set_command}\n" + autocommands << " au! BufNewFile,BufRead #{set_globs.join(",")} #{set_command}\n" end end -- cgit v1.2.3