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

fix(git): handle non-unix stderr redirection #4

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

scottmckendry
Copy link
Contributor

This PR is specifically for the Windows crowd.

ArrestedDevelopmentDavidCrossGIF

I tried running this plugin on my Windows machine and was getting a blank ASCII. After some head-scratching, I was able to determine this was due to the Unix-style stderr redirection on a couple of the functions in the git.lua file.

I've fixed this by adding two new local variables and using the built-in vim.fn.has API to determine the correct output.

Copy link
Owner

@juansalvatore juansalvatore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried it out, thanks for the improvement!

@juansalvatore juansalvatore merged commit 3d20b9a into juansalvatore:main Jun 27, 2024
@noahlias
Copy link

The vim.fn.has() return 0|1 not boolean,
this works on windows but not on unix
it will generate a NUL file always

It should be modifed.

local is_windows = vim.fn.has("win32") ==1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants