3
3
" Maintainer: skywind3000 (at) gmail.com, 2016, 2017, 2018, 2019, 2020
4
4
" Homepage: http://www.vim.org/scripts/script.php?script_id=5431
5
5
"
6
- " Last Modified: 2020/03/12 18 :54
6
+ " Last Modified: 2020/03/22 15 :54
7
7
"
8
8
" Run shell command in background and output to quickfix:
9
9
" :AsyncRun[!] [options] {cmd} ...
@@ -987,17 +987,17 @@ endfunc
987
987
988
988
" find project root
989
989
function ! s: find_root (path , markers, strict)
990
- function ! s: guess_root (filename, markers)
991
- let fullname = asyncrun#fullname (a: filename )
992
- if exists (' b:asyncrun_root' )
990
+ function ! s: guess_root (filename, markers)
991
+ let fullname = asyncrun#fullname (a: filename )
992
+ if exists (' b:asyncrun_root' )
993
993
return b: asyncrun_root
994
- endif
995
- if fullname = ~ ' ^fugitive:/'
996
- if exists (' b:git_dir' )
997
- return fnamemodify (b: git_dir , ' :h' )
998
- endif
999
- return ' ' " skip any fugitive buffers early
1000
- endif
994
+ endif
995
+ if fullname = ~ ' ^fugitive:/'
996
+ if exists (' b:git_dir' )
997
+ return fnamemodify (b: git_dir , ' :h' )
998
+ endif
999
+ return ' ' " skip any fugitive buffers early
1000
+ endif
1001
1001
let pivot = fullname
1002
1002
if ! isdirectory (pivot)
1003
1003
let pivot = fnamemodify (pivot, ' :h' )
@@ -1006,7 +1006,15 @@ function! s:find_root(path, markers, strict)
1006
1006
let prev = pivot
1007
1007
for marker in a: markers
1008
1008
let newname = s: path_join (pivot, marker)
1009
- if filereadable (newname)
1009
+ if stridx (newname, ' *' ) >= 0 || stridx (newname, ' ?' ) >= 0
1010
+ if glob (newname) != ' '
1011
+ return pivot
1012
+ endif
1013
+ elseif stridx (newname, ' [' ) >= 0 || stridx (newname, ' ]' ) >= 0
1014
+ if glob (newname) != ' '
1015
+ return pivot
1016
+ endif
1017
+ elseif filereadable (newname)
1010
1018
return pivot
1011
1019
elseif isdirectory (newname)
1012
1020
return pivot
@@ -1238,6 +1246,9 @@ function! s:start_in_terminal(opts)
1238
1246
endif
1239
1247
endif
1240
1248
endif
1249
+ if get (a: opts , ' reuse' , 1 ) == 0
1250
+ let avail = -1
1251
+ endif
1241
1252
endfor
1242
1253
let focus = get (a: opts , ' focus' , 1 )
1243
1254
if pos == ? ' tab'
@@ -1829,7 +1840,7 @@ endfunc
1829
1840
" asyncrun - version
1830
1841
" ----------------------------------------------------------------------
1831
1842
function ! asyncrun#version ()
1832
- return ' 2.6.7 '
1843
+ return ' 2.6.8 '
1833
1844
endfunc
1834
1845
1835
1846
0 commit comments