mirror of https://github.com/folke/lazy.nvim.git
fix(ui): trailing space in button row. Fixes #884
This commit is contained in:
parent
56b1f7715e
commit
410a7360c1
|
@ -113,30 +113,35 @@ end
|
||||||
|
|
||||||
function M:title()
|
function M:title()
|
||||||
self:nl():nl()
|
self:nl():nl()
|
||||||
for _, mode in ipairs(ViewConfig.get_commands()) do
|
local modes = vim.tbl_filter(function(c)
|
||||||
if mode.button then
|
return c.button
|
||||||
local title = " " .. mode.name:sub(1, 1):upper() .. mode.name:sub(2) .. " (" .. mode.key .. ") "
|
end, ViewConfig.get_commands())
|
||||||
if mode.name == "home" then
|
|
||||||
if self.view.state.mode == "home" then
|
|
||||||
title = " lazy.nvim " .. Config.options.ui.icons.lazy
|
|
||||||
else
|
|
||||||
title = " lazy.nvim (H) "
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.view.state.mode == mode.name then
|
for c, mode in ipairs(modes) do
|
||||||
if mode.name == "home" then
|
local title = " " .. mode.name:sub(1, 1):upper() .. mode.name:sub(2) .. " (" .. mode.key .. ") "
|
||||||
self:append(title, "LazyH1", { wrap = true })
|
if mode.name == "home" then
|
||||||
else
|
if self.view.state.mode == "home" then
|
||||||
self:append(title, "LazyButtonActive", { wrap = true })
|
title = " lazy.nvim " .. Config.options.ui.icons.lazy
|
||||||
self:highlight({ ["%(.%)"] = "LazySpecial" })
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
self:append(title, "LazyButton", { wrap = true })
|
title = " lazy.nvim (H) "
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.view.state.mode == mode.name then
|
||||||
|
if mode.name == "home" then
|
||||||
|
self:append(title, "LazyH1", { wrap = true })
|
||||||
|
else
|
||||||
|
self:append(title, "LazyButtonActive", { wrap = true })
|
||||||
self:highlight({ ["%(.%)"] = "LazySpecial" })
|
self:highlight({ ["%(.%)"] = "LazySpecial" })
|
||||||
end
|
end
|
||||||
self:append(" ")
|
else
|
||||||
|
self:append(title, "LazyButton", { wrap = true })
|
||||||
|
self:highlight({ ["%(.%)"] = "LazySpecial" })
|
||||||
end
|
end
|
||||||
|
if c == #modes then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
self:append(" ")
|
||||||
end
|
end
|
||||||
self:nl()
|
self:nl()
|
||||||
if self.progress.done < self.progress.total then
|
if self.progress.done < self.progress.total then
|
||||||
|
|
Loading…
Reference in New Issue