We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asynctasks.vim/plugin/asynctasks.vim
Lines 936 to 951 in 3c68c42
打开一个 buftype 为 'nofile' 的 buffer,如果执行的命令里面带有 $(VIM_FILEDIR),会报错 Warning: macro $(VIM_FILEDIR) is empty in current buffer.
buftype
'nofile'
$(VIM_FILEDIR)
Warning: macro $(VIM_FILEDIR) is empty in current buffer
对于 buftype 为 'nofile' 的 buffer, expand("%:p") 为空字符串,但是 expand("%:p:h") 却返回该缓冲区所在的文件夹路径且不为空,并且在同样的 buffer 里面, $(VIM_FILEDIR) 这个宏在 asyncrun.vim 里也工作正常。
expand("%:p")
expand("%:p:h")
因此可不可以将 $(VIM_FILEDIR) 排除在 disable 之外呢?
disable
The text was updated successfully, but these errors were encountered:
只是 asyncrun 没有做这个检测,就有人用错过,这个东西我想过,nofile 的 buffer 居然有 FILEDIR,道理上说不通,而你在 nofile 的 buffer 里运行 echo expand("%:p") 其实显示的是 Vim 的当前目录 :pwd 返回那个,因为 % 是空字符串,对空字符串求绝对路径,vim 就给了一个当前路径。
nofile
echo expand("%:p")
:pwd
%
并不是真正意义上的 file dir,既然如此你就用 $(VIM_CWD) 就行了嘛,其实就是不写 cwd= 字段。
$(VIM_CWD)
cwd=
所以 nofile 之类的 buffer,一般也就运行一些和项目以及当前路径相关的 task.
Sorry, something went wrong.
OK, 已用 $(VIM_CWD) 代替了
恩,有一天vim可能真的要靠cd 路径来模拟vscode的open folder 做项目管理这事情。
No branches or pull requests
asynctasks.vim/plugin/asynctasks.vim
Lines 936 to 951 in 3c68c42
问题:
打开一个
buftype
为'nofile'
的 buffer,如果执行的命令里面带有$(VIM_FILEDIR)
,会报错Warning: macro $(VIM_FILEDIR) is empty in current buffer
.原因
对于
buftype
为'nofile'
的 buffer,expand("%:p")
为空字符串,但是expand("%:p:h")
却返回该缓冲区所在的文件夹路径且不为空,并且在同样的 buffer 里面,$(VIM_FILEDIR)
这个宏在 asyncrun.vim 里也工作正常。因此可不可以将
$(VIM_FILEDIR)
排除在disable
之外呢?The text was updated successfully, but these errors were encountered: