juansalvatore / git-dashboard-nvim

Your git contributions heatmap chart inside your favorite nvim dashboards.
MIT License
50 stars 4 forks source link

NUL file created when opening nvim #7

Closed sudo-tee closed 4 months ago

sudo-tee commented 4 months ago

I have an issue where everytime I open nvim a NUL file is created on linux

I investigated and found that the issue was with the way windows detection is done in the file git.lua

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

is_windows will be 0 at that point and

local null = is_windows and "NUL" or "/dev/null"

Since lua does not interpret 0 as being false the null file is then 'NUL'

the windows check sould be

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

Thanks for your great plugin

juansalvatore commented 4 months ago

Thanks for checking this and sharing the corrected check!