Skip to content

Commit 314e8d5

Browse files
author
skywind3000
committed
new macro $(VIM_WORKSPACE) or <workspace> for current workspace folder
1 parent 35a2580 commit 314e8d5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

plugin/asyncrun.vim

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: skywind3000 (at) gmail.com, 2016, 2017, 2018, 2019, 2020
44
" Homepage: http://www.vim.org/scripts/script.php?script_id=5431
55
"
6-
" Last Modified: 2020/04/07 20:09
6+
" Last Modified: 2020/04/07 20:18
77
"
88
" Run shell command in background and output to quickfix:
99
" :AsyncRun[!] [options] {cmd} ...
@@ -1682,14 +1682,18 @@ endfunc
16821682
" get workspace
16831683
"----------------------------------------------------------------------
16841684
function! asyncrun#workspace()
1685+
let workspace = ''
16851686
if exists('b:asyncrun_workspace')
1686-
return b:asyncrun_workspace
1687+
let workspace = b:asyncrun_workspace
16871688
elseif exists('t:asyncrun_workspace')
1688-
return t:asyncrun_workspace
1689+
let workspace = t:asyncrun_workspace
16891690
elseif exists('g:asyncrun_workspace')
1690-
return g:asyncrun_workspace
1691+
let workspace = g:asyncrun_workspace
16911692
endif
1692-
return getcwd()
1693+
if workspace == '-'
1694+
return getcwd()
1695+
endif
1696+
return (workspace != '')? workspace : getcwd()
16931697
endfunc
16941698

16951699

0 commit comments

Comments
 (0)