mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-20 13:26:45 +00:00
feat: added config.ui.wrap
and improved wrapping when wrap=true. Fixes #422
This commit is contained in:
parent
c389ad552b
commit
d6fc848067
4 changed files with 21 additions and 5 deletions
|
@ -21,7 +21,7 @@ end
|
|||
|
||||
---@param str string
|
||||
---@param hl? string|Extmark
|
||||
---@param opts? {indent?: number, prefix?: string}
|
||||
---@param opts? {indent?: number, prefix?: string, wrap?: boolean}
|
||||
function Text:append(str, hl, opts)
|
||||
opts = opts or {}
|
||||
if #self._lines == 0 then
|
||||
|
@ -39,7 +39,13 @@ function Text:append(str, hl, opts)
|
|||
if l > 1 then
|
||||
self:nl()
|
||||
end
|
||||
if str ~= "" and self:col() > 0 and self:col() + vim.fn.strwidth(line) + self.padding > self.wrap then
|
||||
if
|
||||
Config.options.ui.wrap
|
||||
and opts.wrap
|
||||
and str ~= ""
|
||||
and self:col() > 0
|
||||
and self:col() + vim.fn.strwidth(line) + self.padding > self.wrap
|
||||
then
|
||||
self:nl()
|
||||
end
|
||||
table.insert(self._lines[#self._lines], {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue