Skip to content

Commit 641de26

Browse files
author
skywind3000
committed
asyncrun#get_root(0) returns current root
1 parent b098775 commit 641de26

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

plugin/asyncrun.vim

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: skywind3000 (at) gmail.com, 2016-2024
44
" Homepage: https://github.com/skywind3000/asyncrun.vim
55
"
6-
" Last Modified: 2024/07/02 00:23
6+
" Last Modified: 2024/07/26 10:46:36
77
"
88
" Run shell command in background and output to quickfix:
99
" :AsyncRun[!] [options] {cmd} ...
@@ -1248,7 +1248,11 @@ function! asyncrun#get_root(path, ...)
12481248
endif
12491249
endif
12501250
let strict = (a:0 >= 2)? (a:2) : 0
1251-
let l:hr = s:find_root(a:path, markers, strict)
1251+
if type(a:path) == 0 && (a:path == 0)
1252+
let l:hr = s:find_root('%', markers, strict)
1253+
else
1254+
let l:hr = s:find_root(a:path, markers, strict)
1255+
endif
12521256
if s:asyncrun_windows
12531257
let l:hr = s:StringReplace(l:hr, '/', "\\")
12541258
endif
@@ -2337,7 +2341,7 @@ endfunc
23372341
" asyncrun - version
23382342
"----------------------------------------------------------------------
23392343
function! asyncrun#version()
2340-
return '2.13.0'
2344+
return '2.13.1'
23412345
endfunc
23422346

23432347

0 commit comments

Comments
 (0)