noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: window offsets applies to the bottom of the window when the window appears above the cursor

Open ofseed opened this issue 1 year ago • 8 comments

Did you check docs and existing issues?

  • [X] I have read all the noice.nvim docs
  • [X] I have searched the existing issues of noice.nvim
  • [X] 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 avatar Sep 11 '23 02:09 ofseed

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[bot] avatar Jul 06 '24 01:07 github-actions[bot]

This issue still exits.

ofseed avatar Jul 06 '24 13:07 ofseed

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[bot] avatar Aug 07 '24 01:08 github-actions[bot]

This issue still exits.

ofseed avatar Aug 07 '24 05:08 ofseed

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[bot] avatar Sep 07 '24 01:09 github-actions[bot]

This issue still exits.

ofseed avatar Sep 07 '24 08:09 ofseed