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

vim.lsp.buf.format() scrolls window on nightly #25370

Closed
TymekDev opened this issue Sep 26, 2023 · 4 comments
Closed

vim.lsp.buf.format() scrolls window on nightly #25370

TymekDev opened this issue Sep 26, 2023 · 4 comments
Labels
api libnvim, Nvim RPC API bug-regression wrong behavior that was introduced in a previous commit (please bisect) has:bisected issue has been tracked to a specific commit lsp
Milestone

Comments

@TymekDev
Copy link
Sponsor

Hey, I have just noticed that commit 9b9030f introduces an unexpected window scrolling. Whenever I call vim.lsp.buf.format() I end up with window scrolled as if I used zb.

CleanShot.2023-09-26.at.09.51.06.mp4

This appears to be affected by both scrolloff and window size. If the window contains fewer lines, then it does not necessarily happen.

Config for reproduction:

-- lazy.nvim bootstrap start
local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)
-- lazy.nvim bootstrap end

require("lazy").setup({
  {
    "neovim/nvim-lspconfig",
    config = function()
      require("lspconfig").r_language_server.setup({
        cmd = { "R", "--vanilla", "--slave", "-e", "languageserver::run()" },
      })
    end,
  },
})

Originally posted by @TymekDev in #24889 (comment)

@zeertzjq zeertzjq added api libnvim, Nvim RPC API bug-regression wrong behavior that was introduced in a previous commit (please bisect) has:bisected issue has been tracked to a specific commit labels Sep 26, 2023
@zeertzjq zeertzjq added this to the 0.10 milestone Sep 26, 2023
@PMassicotte

This comment was marked as duplicate.

@justinmk justinmk added the lsp label Nov 15, 2023
@Givo29

This comment was marked as spam.

@bfredl
Copy link
Member

bfredl commented Mar 13, 2024

Some follow-up changes has been merged to the bisected PR. Please try again and see if the behavior makes sense now.

@zeertzjq zeertzjq added the needs:response waiting for reply from the author label Mar 19, 2024
@TymekDev
Copy link
Sponsor Author

@bfredl looks good! I cannot reproduce the issue anymore.

@github-actions github-actions bot removed the needs:response waiting for reply from the author label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API bug-regression wrong behavior that was introduced in a previous commit (please bisect) has:bisected issue has been tracked to a specific commit lsp
Projects
None yet
Development

No branches or pull requests

6 participants