folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
3.95k stars 88 forks source link

bug: Truncated prompts when using Telescope actions #853

Closed enrique-villarrealp closed 3 weeks ago

enrique-villarrealp commented 3 weeks ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0 Release

Operating system/version

MacOS 14.4.1

Describe the bug

When trying to use a Telescope action on a picker such as git_branches that requires an input, the resulting prompt is not drawn at the correct position, and is cut off.

image

Additionally, when trying to open future prompts, the old truncated prompt's title is utilized instead of the actual prompt being called. Example calling CmdLine with :

image

I suspect it might be related to this: https://github.com/folke/noice.nvim/issues/767

Steps To Reproduce

  1. Run : Telescope git_branches
  2. Type any branch name and use C-a to call the create_branch action, see truncated prompt
  3. After doing that, call any other prompt such as Cmd line

Expected Behavior

  1. Input prompt for the Telescope shows up in the correct position according to presets = {command_palette = true} and isn't truncated
  2. After this, prompts should be rendered with their proper title, not the previously called action's prompt

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",
  {
      "folke/noice.nvim",
  event = "VeryLazy",
  opts = {
        lsp = {
    -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
    override = {
      ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
      ["vim.lsp.util.stylize_markdown"] = true,
      ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
    },
  },
  -- you can enable a preset for easier configuration
  presets = {
    bottom_search = true, -- use a classic bottom cmdline for search
    command_palette = true, -- position the cmdline and popupmenu together
    long_message_to_split = true, -- long messages will be sent to a split
    inc_rename = false, -- enables an input dialog for inc-rename.nvim
    lsp_doc_border = false, -- add a border to hover docs and signature help
  },
    -- add any options here
  },
  dependencies = {
    -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
    "MunifTanjim/nui.nvim",
    -- OPTIONAL:
    --   `nvim-notify` is only needed, if you want to use the notification view.
    --   If not available, we use `mini` as the fallback
    "rcarriga/nvim-notify",
    }
  },
  { "nvim-telescope/telescope.nvim", tag = "0.1.6", dependencies = {"nvim-lua/plenary.nvim"} }
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
folke commented 3 weeks ago

Both issues are fixed. I reverted the change of showing inputs at the cursor and fixed that issue with incorrect titles