From a026f7395324aad8df1cbd45112d620f528123ba Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 13 Oct 2023 12:37:41 +0200 Subject: [PATCH] docs: fix types for `keys`. Fixes #1109 --- README.md | 2 +- lua/lazy/types.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 13b25e1..86cc9ef 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ require("lazy").setup({ | **event** | `string?` or `string[]` or `fun(self:LazyPlugin, event:string[]):string[]` or `{event:string[]\|string, pattern?:string[]\|string}` | Lazy-load on event. Events can be specified as `BufEnter` or with a pattern like `BufEnter *.lua` | | **cmd** | `string?` or `string[]` or `fun(self:LazyPlugin, cmd:string[]):string[]` | Lazy-load on command | | **ft** | `string?` or `string[]` or `fun(self:LazyPlugin, ft:string[]):string[]` | Lazy-load on filetype | -| **keys** | `string?` or `string[]` or `LazyKeys[]` or `fun(self:LazyPlugin, keys:string[]):(string \| LazyKeys)[]` | Lazy-load on key mapping | +| **keys** | `string?` or `string[]` or `LazyKeysSpec[]` or `fun(self:LazyPlugin, keys:string[]):(string \| LazyKeysSpec)[]` | Lazy-load on key mapping | | **module** | `false?` | Do not automatically load this Lua module when it's required somewhere | | **priority** | `number?` | Only useful for **start** plugins (`lazy=false`) to force loading certain plugins first. Default priority is `50`. It's recommended to set this to a high number for colorschemes. | | **optional** | `boolean?` | When a spec is tagged optional, it will only be included in the final spec, when the same plugin has been specified at least once somewhere else without `optional`. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins | diff --git a/lua/lazy/types.lua b/lua/lazy/types.lua index e83b9c4..54c0930 100644 --- a/lua/lazy/types.lua +++ b/lua/lazy/types.lua @@ -61,10 +61,10 @@ ---@field _ LazyPluginState ---@class LazyPluginSpecHandlers ----@field event? string[]|string|fun(self:LazyPlugin, event:string[]):string[] +---@field event? string[]|string|LazyEventSpec[]|fun(self:LazyPlugin, event:string[]):string[] ---@field cmd? string[]|string|fun(self:LazyPlugin, cmd:string[]):string[] ---@field ft? string[]|string|fun(self:LazyPlugin, ft:string[]):string[] ----@field keys? string|string[]|LazyKeys[]|fun(self:LazyPlugin, keys:string[]):(string|LazyKeys)[] +---@field keys? string|string[]|LazyKeysSpec[]|fun(self:LazyPlugin, keys:string[]):(string|LazyKeys)[] ---@field module? false ---@class LazyPluginSpec: LazyPluginBase,LazyPluginSpecHandlers,LazyPluginHooks,LazyPluginRef