diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-04 19:00:16 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-04 19:00:16 +0200 |
commit | d221139bd70fd474be52237dc8e6440e6da632bd (patch) | |
tree | 5b94fd6f5ffed4225d6540cb81705f7c319f4818 /scripts | |
parent | 073e4d44beb431e3846992d9145719d90d626a42 (diff) | |
download | vim-polyglot-d221139bd70fd474be52237dc8e6440e6da632bd.tar.gz vim-polyglot-d221139bd70fd474be52237dc8e6440e6da632bd.zip |
Address BufWritePost error, fixes #573
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build | 12 |
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 != "" |