diff options
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | autoload/polyglot/shebang.vim | 5 | ||||
| -rw-r--r-- | ftdetect/polyglot.vim | 7 | ||||
| -rwxr-xr-x | scripts/build | 11 | 
4 files changed, 15 insertions, 10 deletions
| @@ -7,4 +7,4 @@ test:  	@ scripts/test  dev: -	@ find scripts autoload/polyglot ftdetect tests . -type f -maxdepth 1 | DEV=1 entr bash -c 'make && make test' +	@ find scripts autoload/polyglot ftdetect tests . -type f -maxdepth 1 | DEV=1 entr bash -c 'make' diff --git a/autoload/polyglot/shebang.vim b/autoload/polyglot/shebang.vim index ef6bc0ed..a8f10348 100644 --- a/autoload/polyglot/shebang.vim +++ b/autoload/polyglot/shebang.vim @@ -449,6 +449,11 @@ func! polyglot#shebang#VimDetect()    endif +	if line1 =~ '^# ' || getline(2) =~ '^# ' || getline(3) =~ '^# ' || getline(4) =~ '^# ' || getline(5) =~ '^# ' +    setf FALLBACK conf +    return 1 +  endif +    return 1  endfunc diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 3132a339..4d6935fe 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -2659,13 +2659,13 @@ func! s:Observe(fn)    augroup END  endfunc -au BufNewFile,BufRead,StdinReadPost * if expand("<afile>:e") == "" | +au BufNewFile,BufRead,StdinReadPost,BufWritePost * if expand("<afile>:e") == "" |    \ call polyglot#shebang#Detect() | endif -au BufWinEnter * if &ft == "" && expand("<afile>:e") == ""  | +au BufWinEnter * if &ft == "" && expand("<afile>:e") == "" |    \ call s:Observe('shebang#Detect') | endif -au FileType * au! polyglot-observer +au BufWritePost * au! polyglot-observer  augroup END @@ -3528,7 +3528,6 @@ if exists("did_load_filetypes") && exists("g:polyglot_disabled")    runtime! extras/filetype.vim  endif -  let s:runtime = resolve($VIMRUNTIME)  let s:base = resolve(expand('<sfile>:p:h:h')) diff --git a/scripts/build b/scripts/build index 3933a87e..758b3aff 100755 --- a/scripts/build +++ b/scripts/build @@ -113,9 +113,9 @@ def sort_packages(packages)    each_child = lambda { |n, &b|      [        implicit_dependencies[n] || [], -      packages[n]["dependencies"] || [], -      packages[n]["after"] || [] -    ].flatten.each(&b) +      packages[n] ? packages[n]["dependencies"] || [] : [], +      packages[n] ? packages[n]["after"] || [] : [] +    ].flatten.each { |e| b.call(e) if packages[e] }    }    TSort.tsort(each_node, each_child).map { |a| packages[a] } @@ -248,11 +248,11 @@ def load_languages  end  def load_packages -  YAML.load_stream(File.read('packages.yaml')) +  YAML.load_stream(File.read('packages.yaml')) || []  end  def load_heuristics -  YAML.load_stream(File.read('heuristics.yaml')) +  YAML.load_stream(File.read('heuristics.yaml')) || []  end  def parse_remote(remote) @@ -486,6 +486,7 @@ def extract(packages)    )    FileUtils.rm_rf(all_dirs) +  Dir.mkdir('extras') unless File.exists?('extras')    for dir in Dir.glob("*", base: "autoload")      if dir != "polyglot" | 
