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: mini.jump `t` doesn't work if the following key comes too late when using with noice.nvim #827

Open Frederick888 opened 1 month ago

Frederick888 commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.10.0

Operating system/version

macOS 14.5

Describe the bug

Since I had issues with clever-f (#824), I tried https://github.com/echasnovski/mini.jump, and I noticed that if I e.g. dt, then wait for one second or two, and then hit another key, it does nothing.

Steps To Reproduce

  1. nvim -u repro.lua repro.lua
  2. Hit dt
  3. Wait for a second or two (Without noice.nvim, it shows (mini.jump) Enter target single character _ in cmd area. This might be relevant?)
  4. Hit another key

Expected Behavior

It deletes contents until the character given by the third key.

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",
  "MunifTanjim/nui.nvim",
  "folke/noice.nvim",
  -- "rhysd/clever-f.vim",
  "echasnovski/mini.jump",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

require("noice").setup({
  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
  },
})

require('mini.jump').setup()
Frederick888 commented 1 month ago

I did a bisect and the first bad commit was a0c6203d551242322ac7995b26d4e320140e05b1.

This particular issue was gone after checking out a0c6203d551242322ac7995b26d4e320140e05b1~. There were some minor glitches:

  1. If I do the dt -> wait -> another flow key before the first mini view pops up (using the timer from #824's repro.lua), there won't be any mini views showing at all
  2. If I do the flow after the mini views started popping up, it'll pause the pop-ups, move the existing pop-ups to the left (to accommodate (mini.jump) Enter target single character _ presumably), show (mini.jump) Enter target single character _ after I hit the third key and resume
  3. The pop-ups lose highlights during the wait between dt and the third key

It seems #824 is the same issue, as checking out a0c6203d551242322ac7995b26d4e320140e05b1~ resolved it too.

github-actions[bot] commented 16 minutes ago

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.