mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
fix(dashboard): calculate proper offset when item has no text
This commit is contained in:
parent
78f44f720b
commit
6e3b9546de
1 changed files with 5 additions and 2 deletions
|
@ -695,7 +695,9 @@ function D:update()
|
|||
end
|
||||
end
|
||||
if item then
|
||||
last = { item._.row, (self.lines[item._.row]:find("[%w%d%p]", item._.col + 1) or item._.col + 1) - 1 }
|
||||
local col = self.lines[item._.row]:find("[%w%d%p]", item._.col + 1)
|
||||
col = col or (item._.col + 1 + (item.indent and (item.indent + 1) or 0))
|
||||
last = { item._.row, (col or item._.col + 1) - 1 }
|
||||
end
|
||||
vim.api.nvim_win_set_cursor(self.win, last)
|
||||
end,
|
||||
|
@ -991,6 +993,7 @@ function M.sections.terminal(opts)
|
|||
end
|
||||
return {
|
||||
action = opts.action,
|
||||
key = opts.key,
|
||||
render = function(_, pos)
|
||||
self:trace("terminal.render")
|
||||
local win = vim.api.nvim_open_win(buf, false, {
|
||||
|
@ -1019,7 +1022,7 @@ function M.sections.terminal(opts)
|
|||
self.on("Closed", close, self.augroup)
|
||||
self:trace()
|
||||
end,
|
||||
text = ("terminal\n"):rep(height - 1),
|
||||
text = ("\n"):rep(height - 1),
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue