mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-09-23 05:35:48 +00:00
feat: support puc lua
This commit is contained in:
parent
6c3bda4aca
commit
b16d225786
4 changed files with 4 additions and 7 deletions
|
@ -23,7 +23,7 @@ M.defaults = {
|
||||||
local_spec = true, -- load project specific .lazy.lua spec files. They will be added at the end of the spec.
|
local_spec = true, -- load project specific .lazy.lua spec files. They will be added at the end of the spec.
|
||||||
lockfile = vim.fn.stdpath("config") .. "/lazy-lock.json", -- lockfile generated after running update.
|
lockfile = vim.fn.stdpath("config") .. "/lazy-lock.json", -- lockfile generated after running update.
|
||||||
---@type number? limit the maximum amount of concurrent tasks
|
---@type number? limit the maximum amount of concurrent tasks
|
||||||
concurrency = jit.os:find("Windows") and (vim.uv.available_parallelism() * 2) or nil,
|
concurrency = (vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1) and (vim.uv.available_parallelism() * 2) or nil,
|
||||||
git = {
|
git = {
|
||||||
-- defaults for the `Lazy log` command
|
-- defaults for the `Lazy log` command
|
||||||
-- log = { "--since=3 days ago" }, -- show commits from the last 3 days
|
-- log = { "--since=3 days ago" }, -- show commits from the last 3 days
|
||||||
|
|
|
@ -5,7 +5,7 @@ local M = {}
|
||||||
|
|
||||||
---@type LazyProfile[]
|
---@type LazyProfile[]
|
||||||
M._profiles = { { name = "lazy" } }
|
M._profiles = { { name = "lazy" } }
|
||||||
M.is_win = jit.os:find("Windows")
|
M.is_win = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1
|
||||||
|
|
||||||
---@param data (string|{[string]:string})?
|
---@param data (string|{[string]:string})?
|
||||||
---@param time number?
|
---@param time number?
|
||||||
|
|
|
@ -52,9 +52,6 @@ function M.setup(spec, opts)
|
||||||
if vim.fn.has("nvim-0.8.0") ~= 1 then
|
if vim.fn.has("nvim-0.8.0") ~= 1 then
|
||||||
return vim.notify("lazy.nvim requires Neovim >= 0.8.0", vim.log.levels.ERROR, { title = "lazy.nvim" })
|
return vim.notify("lazy.nvim requires Neovim >= 0.8.0", vim.log.levels.ERROR, { title = "lazy.nvim" })
|
||||||
end
|
end
|
||||||
if not (pcall(require, "ffi") and jit and jit.version) then
|
|
||||||
return vim.notify("lazy.nvim requires Neovim built with LuaJIT", vim.log.levels.ERROR, { title = "lazy.nvim" })
|
|
||||||
end
|
|
||||||
local start = vim.uv.hrtime()
|
local start = vim.uv.hrtime()
|
||||||
|
|
||||||
-- use the Neovim cache if available
|
-- use the Neovim cache if available
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
local ffi = require("ffi")
|
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@class LazyStats
|
---@class LazyStats
|
||||||
|
@ -34,6 +32,7 @@ end
|
||||||
function M.cputime()
|
function M.cputime()
|
||||||
if M.C == nil then
|
if M.C == nil then
|
||||||
pcall(function()
|
pcall(function()
|
||||||
|
local ffi = require("ffi")
|
||||||
ffi.cdef([[
|
ffi.cdef([[
|
||||||
typedef long time_t;
|
typedef long time_t;
|
||||||
typedef int clockid_t;
|
typedef int clockid_t;
|
||||||
|
@ -48,6 +47,7 @@ function M.cputime()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function real()
|
local function real()
|
||||||
|
local ffi = require("ffi")
|
||||||
local pnano = assert(ffi.new("nanotime[?]", 1))
|
local pnano = assert(ffi.new("nanotime[?]", 1))
|
||||||
local CLOCK_PROCESS_CPUTIME_ID = jit.os == "OSX" and 12 or 2
|
local CLOCK_PROCESS_CPUTIME_ID = jit.os == "OSX" and 12 or 2
|
||||||
ffi.C.clock_gettime(CLOCK_PROCESS_CPUTIME_ID, pnano)
|
ffi.C.clock_gettime(CLOCK_PROCESS_CPUTIME_ID, pnano)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue