backport: fix(vim.fs): dirname() returns "." on mingw/msys2 (#30484)

fix(vim.fs): dirname() returns "." on mingw/msys2 #30480

Problem:
`vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on
mingw/msys2.

Solution:
- Check for "mingw" when deciding `iswin`.
- Use `has("win32")` where possible, it works in "fast" contexts since
  b02eeb6a72.
This commit is contained in:
Justin M. Keyes
2024-09-23 06:41:47 -07:00
committed by GitHub
parent 2a8d80a442
commit 6a44055a71
5 changed files with 12 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
local health = vim.health
local iswin = vim.uv.os_uname().sysname == 'Windows_NT'
local iswin = vim.fn.has('win32') == 1
local M = {}