Skip to content
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

Causes a nonzero exit status when used in combination with vipe #19

Open
niklaas opened this issue Jan 8, 2024 · 3 comments
Open

Causes a nonzero exit status when used in combination with vipe #19

niklaas opened this issue Jan 8, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@niklaas
Copy link
Owner

niklaas commented Jan 8, 2024

❯ ls | vipe | xargs echo
nvim exited nonzero, aborting
@niklaas
Copy link
Owner Author

niklaas commented Jan 8, 2024

Closing with :w and then :q works as expected while closing with :wq causes the error.

@niklaas
Copy link
Owner Author

niklaas commented Jan 8, 2024

call system('cd ' . expand('#' . a:buffer . ':p:h:S') . ' && git rev-parse --is-inside-work-tree --prefix ' . expand('#' . a:buffer . ':h:S'))

is the culprit because it's the last call which updates v:shell_error. When vim is opened using vipe, this isn't within a git repository, so the exit code is nonzero. This will be leaked to vim's exit code.

I haven't found a clever way to prevent this yet since v:shell_error is read only and there's no way to circumvent it.

@niklaas
Copy link
Owner Author

niklaas commented Jan 8, 2024

OK, for the time being, my workaround is not to add the plugin as the last one since that seems not to call the call system mentioned above as the very last one. 😅

@niklaas niklaas added the bug Something isn't working label Jan 8, 2024
niklaas added a commit to niklaas/dotfiles-main that referenced this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant