Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix position of preview window #413

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nnhutan
Copy link

@nnhutan nnhutan commented Jan 20, 2024

When using the hyper theme with preview config, the logo is shown by the preview command on the preview window is always on the top of the screen. I think the problem is on line 7 of file lua/dashboard/preview.lua:

   local row = math.floor(opt.height / 5)

The position of the preview window seems to be fixed.
So my solution is updating the position row of the preview window after rendering all components
In lua/dashboard/theme/hyper.lua, line 495. I found:

  local size = math.floor(vim.o.lines / 2)
      - math.ceil(api.nvim_buf_line_count(config.bufnr) / 2)
      - 2
  local fill = utils.generate_empty_table(size)

So I set the value for the row attribute to size to make the preview window to be on the right position as the normal logo(header)

PS: Forgive my poor English.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant