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

bug: wrong window offset when opening diff #361

Closed
3 tasks done
WilliamHsieh opened this issue Jan 10, 2023 · 5 comments · Fixed by #362 or #376
Closed
3 tasks done

bug: wrong window offset when opening diff #361

WilliamHsieh opened this issue Jan 10, 2023 · 5 comments · Fixed by #362 or #376
Labels
bug Something isn't working

Comments

@WilliamHsieh
Copy link
Contributor

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the exsiting issues of plugins related to this issue

Neovim version (nvim -v)

0.8.2 Release

Operating system/version

wsl / macos

Describe the bug

After opening diff by pressing K on a commit, the top and bottom row of the diff buffer is showing messages from the previous layout.
Feel like it's a wrong offset when creating float command (both with border and without border).

without border
image

with border
image

Steps To Reproduce

  1. nvim -u repro.lua
  2. :Lazy
  3. L to navigate to log panel
  4. place the cursor on the commit from lazy 7260a2b
  5. K

Expected Behavior

I think the top row is reserved for the title of lazy when the diff buffer is open on a certain line? However I found it distracting when reading diff.
I've tried to modify the margin

margin = { top = 3, left = 2, right = 2 },
, however, the behaviour seems to be different with and without borders. I can't quite figure out how to fix it.
Thank's for the great plugin nevertheless!

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@WilliamHsieh WilliamHsieh added the bug Something isn't working label Jan 10, 2023
@folke
Copy link
Owner

folke commented Jan 10, 2023

That's actually intentional, so you normally still see the buttons of Lazy. I need to jump to the top before opening the diff though. Will fix

@WilliamHsieh
Copy link
Contributor Author

WilliamHsieh commented Jan 10, 2023

Apart from this issue, I have some thoughts about the buttons and the idea of panes.
In my understanding, Install, Update, Sync, Clean, and Check are actions, when navigating to these panes and navigating back to Home, the UI isn't changing.
Unlike Profile, Debug, and Help which are different panes with different contexts.
My suggestion is that maybe we can group those action panes under the Home pane, only showing them when under Home panel, not only can it decouple the UI, and it's more intuitive to navigate.

What do you think about it? Would like to hear your thought :)

@folke folke closed this as completed in 8756c09 Jan 10, 2023
@folke
Copy link
Owner

folke commented Jan 10, 2023

true, but then we'd need to have two rows or something like that, which is also not ideal...

@WilliamHsieh
Copy link
Contributor Author

true, but then we'd need to have two rows or something like that, which is also not ideal...

your right, will think about this more.

About the bug, the borderless works fine, however, there's an extra line at the bottom of the buffer with the border, is this intended?

image

@WilliamHsieh
Copy link
Contributor Author

reminder ping @folke, the bug is still present with border (the bottom line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants