diff options
author | Chris Bandy <bandy.chris@gmail.com> | 2020-01-25 09:54:44 -0600 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-01-25 16:54:44 +0100 |
commit | 967486dd716de860db3ef091a9dcb9cb65023534 (patch) | |
tree | 8c2eef92a124e4697ebe5aac1b01d9c2eff674ec | |
parent | e8454d66ab8376cf9c7e42f09749d5bd17d98f89 (diff) | |
download | vim-polyglot-967486dd716de860db3ef091a9dcb9cb65023534.tar.gz vim-polyglot-967486dd716de860db3ef091a9dcb9cb65023534.zip |
Combine ftdetect files in a predictable order (#461)
Bash expands patterns to an alphabetically sorted list of filenames, but
the order depends on LC_COLLATE. On both Linux and BSD, `sort -V` uses
the C locale.
Diffstat (limited to '')
-rwxr-xr-x | build | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -72,8 +72,11 @@ extract() { continue fi - [ -d "${dir}${subtree:-/}ftdetect" ] && for f in "${dir}${subtree:-/}ftdetect/"*; do - cat <<EOF >> tmp/polyglot.vim + ftdetect=("${dir}${subtree:-/}ftdetect"/*) + if [ "$ftdetect" ] && [ "$ftdetect" != "${dir}${subtree:-/}ftdetect/*" ]; then + IFS=$'\n' ftdetect=($(sort -V <<< "${ftdetect[*]}")); unset IFS + for f in "${ftdetect[@]}"; do + cat <<EOF >> tmp/polyglot.vim if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '${pack%%:*}') == -1 augroup filetypedetect " ${pack%%:*}, from ${f##*/ftdetect/} in ${pack#*:} @@ -82,7 +85,8 @@ $(cat "${f}") endif EOF - done + done + fi done |