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

Cursor stuck to the top line when using <C-d> #23

Open
BartSte opened this issue Nov 28, 2024 · 0 comments
Open

Cursor stuck to the top line when using <C-d> #23

BartSte opened this issue Nov 28, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@BartSte
Copy link

BartSte commented Nov 28, 2024

Problem

When placing the cursur on the top line, and then pressing , will not center the cursor. Instead it will stay stuck at the top. You can reproduce this by:

Reproduce

  • Checkout branch main @ e1a63cc (latest commit when writing this)
  • Ensure vim.o.scrolloff is 0.
  • Config
return {
    'arnamak/stay-centered.nvim',
    config = function()
        require('stay-centered').setup( { allow_scroll_move = true })
    end,
}
  • Do the following: gg<C-d>

Cause

For some reason, the if statement of plugin.lua:34 is entered as the line and top are equal. I am not sure, but I think the top variable is wrong. As a result the funtion exits early, missing the norm! zz command.

Workaround

As a workaround you can set allow_scroll_move = false.

@arnamak arnamak added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants