mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(ui): properly wrap ui elements on small screens. Fixes #92
This commit is contained in:
parent
c0c2e1bd68
commit
3415a61789
3 changed files with 7 additions and 2 deletions
|
@ -6,6 +6,7 @@ local Config = require("lazy.core.config")
|
|||
---@class Text
|
||||
---@field _lines TextSegment[][]
|
||||
---@field padding number
|
||||
---@field wrap number
|
||||
local Text = {}
|
||||
|
||||
function Text.new()
|
||||
|
@ -37,6 +38,9 @@ function Text:append(str, hl, opts)
|
|||
if l > 1 then
|
||||
self:nl()
|
||||
end
|
||||
if self:col() > 0 and self:col() + vim.fn.strwidth(line) + self.padding > self.wrap then
|
||||
self:nl()
|
||||
end
|
||||
table.insert(self._lines[#self._lines], {
|
||||
str = line,
|
||||
hl = hl,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue