-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
eliminate errors trying to run a command in a directory that does not exist #1527
Conversation
autoload/go/tool.vim
Outdated
" that don't actually exist on the file system (e.g. vim-fugitive's | ||
" GitDiff). | ||
if !isdirectory(expand("%:p:h")) | ||
let out = go#util#System("exit 1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use false
, instead of exit
? The former is in POSIX, the latter isn't. Also exit
is usually a shell built-in, so this code depends on the shell.
You should also use go#util#Exec()
for all new code, the System()
function will be removed once all calls are rewritten to use that.
c5ff65f
to
caafb65
Compare
@Carpetsmoker PTAL |
caafb65
to
e14cd10
Compare
e14cd10
to
73f660f
Compare
I just added pushed a basic test for this. I do wonder if silently doing nothing is really the best behaviour though. For example |
Meh, also seems that Neovim behaves slightly different |
If I'm working on a fix for the nvim behavior. Thanks for adding some tests! |
PTAL. I'll rebase before merging to apply the fixups correctly. |
I'll rebase now and then merge. |
7a6ca2b
to
a50c831
Compare
Fixes #1399