fix(bigfile): bigfile doesn't work on windows. (#1969)

## Description

`bigfile` checks whether the path and the buffer name are identical in
filetype detection, but on windows, the path separator might be
different. The buffer name should be normalized here.

## Related Issue

Fixes #1722
This commit is contained in:
Anthony 2025-10-19 16:27:16 +08:00 committed by GitHub
parent ba7bbcd0df
commit b4944ff320
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,7 +40,7 @@ function M.setup()
if not path or not buf or vim.bo[buf].filetype == "bigfile" then
return
end
if path ~= vim.api.nvim_buf_get_name(buf) then
if path ~= vim.fs.normalize(vim.api.nvim_buf_get_name(buf)) then
return
end
local size = vim.fn.getfsize(path)