mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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:
@@ -2,7 +2,9 @@ local uv = vim.uv
|
||||
|
||||
local M = {}
|
||||
|
||||
local iswin = uv.os_uname().sysname == 'Windows_NT'
|
||||
-- Can't use `has('win32')` because the `nvim -ll` test runner doesn't support `vim.fn` yet.
|
||||
local sysname = uv.os_uname().sysname:lower()
|
||||
local iswin = not not (sysname:find('windows') or sysname:find('mingw'))
|
||||
local os_sep = iswin and '\\' or '/'
|
||||
|
||||
--- Iterate over all the parents of the given path.
|
||||
|
||||
Reference in New Issue
Block a user