mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-13 05:53:50 -05:00
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.
This commit is contained in:
committed by
Adam Stankiewicz
parent
e8454d66ab
commit
967486dd71
10
build
10
build
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user