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:05:58 -07:00
committed by GitHub
parent 5acdc4499e
commit 47e6b2233f
5 changed files with 12 additions and 11 deletions

View File

@ -3,7 +3,7 @@ local log = require('vim.lsp.log')
local protocol = require('vim.lsp.protocol')
local validate, schedule, schedule_wrap = vim.validate, vim.schedule, vim.schedule_wrap
local is_win = uv.os_uname().version:find('Windows')
local is_win = vim.fn.has('win32') == 1
--- Checks whether a given path exists and is a directory.
---@param filename string path to check