summaryrefslogtreecommitdiffstats
path: root/scripts/build
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-29 19:51:43 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-29 19:51:43 +0200
commit2f133372bc19259888036c659cc618299ae5df59 (patch)
treed8a80763ed0440f92529ea61790ceed959fb11b1 /scripts/build
parent539952f922b27a4a7459092734dd529b77eb00c3 (diff)
downloadvim-polyglot-2f133372bc19259888036c659cc618299ae5df59.tar.gz
vim-polyglot-2f133372bc19259888036c659cc618299ae5df59.zip
Make loading faster for ambiguous extensions
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build28
1 files changed, 1 insertions, 27 deletions
diff --git a/scripts/build b/scripts/build
index 14141aa3..2e767b9b 100755
--- a/scripts/build
+++ b/scripts/build
@@ -503,32 +503,6 @@ def generate_ftdetect(packages, heuristics)
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"]}"
package_heuristics = []
@@ -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