mirror of https://github.com/folke/lazy.nvim.git
feat(ui): added support for setting a title of the lazy window. Fixes #814
This commit is contained in:
parent
97c2f8858c
commit
9dce0816f1
|
@ -107,7 +107,7 @@ require("lazy").setup({
|
||||||
| **keys** | `string?` or `string[]` or `LazyKeys[]` or `fun(self:LazyPlugin, keys:string[]):(string \| LazyKeys)[]` | Lazy-load on key mapping |
|
| **keys** | `string?` or `string[]` or `LazyKeys[]` or `fun(self:LazyPlugin, keys:string[]):(string \| LazyKeys)[]` | Lazy-load on key mapping |
|
||||||
| **module** | `false?` | Do not automatically load this Lua module when it's required somewhere |
|
| **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. |
|
| **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 |
|
| **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 |
|
||||||
|
|
||||||
### Lazy Loading
|
### Lazy Loading
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ return {
|
||||||
git = {
|
git = {
|
||||||
-- defaults for the `Lazy log` command
|
-- defaults for the `Lazy log` command
|
||||||
-- log = { "-10" }, -- show the last 10 commits
|
-- log = { "-10" }, -- show the last 10 commits
|
||||||
log = { "--since=3 days ago" }, -- show commits from the last 3 days
|
log = { "-8" }, -- show commits from the last 3 days
|
||||||
timeout = 120, -- kill processes that take more than 2 minutes
|
timeout = 120, -- kill processes that take more than 2 minutes
|
||||||
url_format = "https://github.com/%s.git",
|
url_format = "https://github.com/%s.git",
|
||||||
-- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version,
|
-- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version,
|
||||||
|
@ -337,6 +337,8 @@ return {
|
||||||
wrap = true, -- wrap the lines in the ui
|
wrap = true, -- wrap the lines in the ui
|
||||||
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
||||||
border = "none",
|
border = "none",
|
||||||
|
title = nil, ---@type string only works when border is not "none"
|
||||||
|
title_pos = "center", ---@type "center" | "left" | "right"
|
||||||
icons = {
|
icons = {
|
||||||
cmd = " ",
|
cmd = " ",
|
||||||
config = "",
|
config = "",
|
||||||
|
@ -757,6 +759,7 @@ To uninstall **lazy.nvim**, you need to remove the following files and directori
|
||||||
| **LazyDir** | **_@text.reference_** | directory |
|
| **LazyDir** | **_@text.reference_** | directory |
|
||||||
| **LazyH1** | **_IncSearch_** | home button |
|
| **LazyH1** | **_IncSearch_** | home button |
|
||||||
| **LazyH2** | **_Bold_** | titles |
|
| **LazyH2** | **_Bold_** | titles |
|
||||||
|
| **LazyLocal** | **_Constant_** | |
|
||||||
| **LazyNoCond** | **_DiagnosticWarn_** | unloaded icon for a plugin where `cond()` was false |
|
| **LazyNoCond** | **_DiagnosticWarn_** | unloaded icon for a plugin where `cond()` was false |
|
||||||
| **LazyNormal** | **_NormalFloat_** | |
|
| **LazyNormal** | **_NormalFloat_** | |
|
||||||
| **LazyProgressDone** | **_Constant_** | progress bar done |
|
| **LazyProgressDone** | **_Constant_** | progress bar done |
|
||||||
|
|
|
@ -48,6 +48,8 @@ M.defaults = {
|
||||||
wrap = true, -- wrap the lines in the ui
|
wrap = true, -- wrap the lines in the ui
|
||||||
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
||||||
border = "none",
|
border = "none",
|
||||||
|
title = nil, ---@type string only works when border is not "none"
|
||||||
|
title_pos = "center", ---@type "center" | "left" | "right"
|
||||||
icons = {
|
icons = {
|
||||||
cmd = " ",
|
cmd = " ",
|
||||||
config = "",
|
config = "",
|
||||||
|
|
|
@ -9,6 +9,8 @@ local ViewConfig = require("lazy.view.config")
|
||||||
---@field zindex? number
|
---@field zindex? number
|
||||||
---@field style? "" | "minimal"
|
---@field style? "" | "minimal"
|
||||||
---@field border? "none" | "single" | "double" | "rounded" | "solid" | "shadow"
|
---@field border? "none" | "single" | "double" | "rounded" | "solid" | "shadow"
|
||||||
|
---@field title? string
|
||||||
|
---@field title_pos? "center" | "left" | "right"
|
||||||
|
|
||||||
---@class LazyFloat
|
---@class LazyFloat
|
||||||
---@field buf number
|
---@field buf number
|
||||||
|
@ -50,6 +52,8 @@ function M:init(opts)
|
||||||
border = self.opts.border,
|
border = self.opts.border,
|
||||||
zindex = self.opts.zindex,
|
zindex = self.opts.zindex,
|
||||||
noautocmd = true,
|
noautocmd = true,
|
||||||
|
title = self.opts.title,
|
||||||
|
title_pos = self.opts.title and self.opts.title_pos or nil,
|
||||||
}
|
}
|
||||||
self:mount()
|
self:mount()
|
||||||
self:on_key(ViewConfig.keys.close, self.close)
|
self:on_key(ViewConfig.keys.close, self.close)
|
||||||
|
|
|
@ -50,7 +50,10 @@ end
|
||||||
function M.create()
|
function M.create()
|
||||||
local self = setmetatable({}, { __index = setmetatable(M, { __index = Float }) })
|
local self = setmetatable({}, { __index = setmetatable(M, { __index = Float }) })
|
||||||
---@cast self LazyView
|
---@cast self LazyView
|
||||||
Float.init(self)
|
Float.init(self, {
|
||||||
|
title = Config.options.ui.title,
|
||||||
|
title_pos = Config.options.ui.title_pos,
|
||||||
|
})
|
||||||
|
|
||||||
if Config.options.ui.wrap then
|
if Config.options.ui.wrap then
|
||||||
vim.wo[self.win].wrap = true
|
vim.wo[self.win].wrap = true
|
||||||
|
|
Loading…
Reference in New Issue