fix: adapt to Nvim deprecations in 0.10 (#3109)

This commit is contained in:
Christian Clason
2024-05-17 14:39:12 +02:00
committed by GitHub
parent 96610122a4
commit bbdbb7593f
10 changed files with 34 additions and 17 deletions

View File

@@ -17,6 +17,13 @@ local utils = {}
utils.iswin = vim.loop.os_uname().sysname == "Windows_NT"
--TODO(clason): Remove when dropping support for Nvim 0.9
utils.islist = vim.fn.has "nvim-0.10" == 1 and vim.islist or vim.tbl_islist
local flatten = function(t)
return vim.iter(t):flatten():totable()
end
utils.flatten = vim.fn.has "nvim-0.10" == 1 and flatten or vim.tbl_flatten
--- Hybrid of `vim.fn.expand()` and custom `vim.fs.normalize()`
---
--- Paths starting with '%', '#' or '<' are expanded with `vim.fn.expand()`.