summaryrefslogtreecommitdiffstats
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build12
1 files changed, 2 insertions, 10 deletions
diff --git a/scripts/build b/scripts/build
index 48ed10a1..fe07db70 100755
--- a/scripts/build
+++ b/scripts/build
@@ -390,17 +390,9 @@ def rule_to_code(rule)
end
if rule.has_key?("filetype")
- if rule.has_key?("fallback")
- return <<~EOS
- setf #{rule["filetype"]}
- call s:WritePostOnce('call polyglot#detect##{camelize(rule["extensions"].first)}()')
- return
- EOS
- end
-
return <<~EOS
set ft=#{rule["filetype"]} | return
- #{indent(rule_to_code(except(rule, "filetype")), 0)}
+ #{indent(rule_to_code(except(rule, "filetype", "fallback")), 0)}
EOS
end
@@ -570,7 +562,7 @@ def generate_ftdetect(packages, heuristics)
for heuristic in package_heuristics.uniq
extensions = heuristic["extensions"].map { |e| "*.#{e}" }
- autocommands << " au! BufNewFile,BufRead #{extensions.join(",")} call polyglot#detect##{camelize(heuristic["extensions"].first)}()\n"
+ autocommands << " au! BufNewFile,BufRead,BufWritePost #{extensions.join(",")} call polyglot#detect##{camelize(heuristic["extensions"].first)}()\n"
end
if autocommands != ""