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: window offsets applies to the bottom of the window when the window appears above the cursor #592

Open
3 tasks done
ofseed opened this issue Sep 11, 2023 · 10 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@ofseed
Copy link

ofseed commented Sep 11, 2023

Did you check docs and existing issues?

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

Neovim version (nvim -v)

v0.10.0-dev-bb38c06

Operating system/version

Arch Linux

Describe the bug

Noice adds offsets when enabling border for LSP docs so that the window will not cover the current line:

image

But if the floating window is above the cursor, the offsets apply to the bottom of the window, and there will be a gap between the window and the cursor

image

Steps To Reproduce

  1. Enable LSP (by nvim-lspconfig)
  2. call vim.lsp.buf.hover()

Expected Behavior

The original vim.lsp.util.open_floating_preview do not have this problem.

image

Repro

vim.o.number = true

local root = vim.fn.fnamemodify("./.repro", ":p")

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

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

require("lazy").setup {
  "folke/tokyonight.nvim",
  {
    "folke/noice.nvim",
    dependencies = {
      "MunifTanjim/nui.nvim",
      "rcarriga/nvim-notify",
    },
    opts = {
      presets = {
        lsp_doc_border = true,
      },
    },
  },
  {
    "neovim/nvim-lspconfig",
    config = function()
      require("lspconfig").lua_ls.setup {}
    end,
  },
}

vim.cmd.colorscheme "tokyonight"
@ofseed ofseed added the bug Something isn't working label Sep 11, 2023
@ofseed ofseed changed the title bug: bug: window offsets applies to the bottom of the window when the window appears above the cursor Sep 11, 2023
Copy link
Contributor

github-actions bot commented Jul 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 6, 2024
@ofseed
Copy link
Author

ofseed commented Jul 6, 2024

This issue still exits.

@github-actions github-actions bot removed the stale label Jul 7, 2024
Copy link
Contributor

github-actions bot commented Aug 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 7, 2024
@ofseed
Copy link
Author

ofseed commented Aug 7, 2024

This issue still exits.

@github-actions github-actions bot removed the stale label Aug 8, 2024
Copy link
Contributor

github-actions bot commented Sep 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 7, 2024
@ofseed
Copy link
Author

ofseed commented Sep 7, 2024

This issue still exits.

@github-actions github-actions bot removed the stale label Sep 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 8, 2024
@ofseed
Copy link
Author

ofseed commented Oct 8, 2024

This issue still exits.

@github-actions github-actions bot removed the stale label Oct 9, 2024
Copy link
Contributor

github-actions bot commented Nov 9, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Nov 9, 2024
@ofseed
Copy link
Author

ofseed commented Nov 9, 2024

This issue still exits.

@github-actions github-actions bot removed the stale label Nov 10, 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
Projects
None yet
Development

No branches or pull requests

1 participant