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: confirm dialog is duplicated in :cdo substitute #302

Closed
eyev0 opened this issue Jan 4, 2023 · 2 comments · Fixed by #858
Closed

bug: confirm dialog is duplicated in :cdo substitute #302

eyev0 opened this issue Jan 4, 2023 · 2 comments · Fixed by #858
Labels
bug Something isn't working

Comments

@eyev0
Copy link

eyev0 commented Jan 4, 2023

Describe the bug
confirm dialog replace with <replacement> (y/n/a/q/l/^E/^Y)? is duplicated every time neovim is switching buffers when iterating over quickfix entries during :cdo s/<pattern>/<replacement>/c
Which version of Neovim are you using?
0.8.2

To Reproduce
minimal.lua

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",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "folke/noice.nvim",
    dependencies = {
      "MunifTanjim/nui.nvim",
      "rcarriga/nvim-notify",
    },
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]])

vim.keymap.set("n", "<C-q><C-o>", ":copen<CR>", { noremap = true })
vim.keymap.set("n", "<C-q><C-j>", ":cnext<CR>", { noremap = true })
vim.keymap.set("n", "<C-q><C-k>", ":cprev<CR>", { noremap = true })

require("noice").setup()

Steps to reproduce the behavior:

  1. grep over two buffers with some common data, e.g. :vimgrep /something/ buffer1 buffer2
  2. run substitute for each quickfix entry: :cdo s/something/else/c
  3. press q or Esc
  4. confirm dialog will be duplicated inside cmdline popup

Expected Behavior
confirm dialog is shown once, pressing l/q/Esc stops substitution

Screenshots
image

@eyev0 eyev0 added the bug Something isn't working label Jan 4, 2023
@eyev0 eyev0 changed the title confirm dialog is duplicated when switching buffers during :cdo substitute bug: confirm dialog is duplicated in :cdo substitute Jan 14, 2023
@eyev0
Copy link
Author

eyev0 commented Jan 14, 2023

fyi this behaviour remains on nightly neovim and latest noice as of now

@RayGuo-ergou
Copy link

RayGuo-ergou commented Jun 15, 2024

Hi @folke I can confirm this still an issue, any chance you can look into it?
image

nvim -v
Found existing alias for "nvim". You should use: "vim"
NVIM v0.11.0-dev-251+g4faad4a95
Build type: RelWithDebInfo
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info

noice.nvim is up to date

Same as quit confirm
image

It looks like effect all confirm window.

@folke folke closed this as completed in d3d8329 Jun 15, 2024
adoyle-h added a commit to adoyle-h/noice.nvim that referenced this issue Jun 18, 2024
* up/main: (76 commits)
  fix(mini): update view options of underlying view. See folke#685
  chore(build): auto-generate vimdoc
  fix(scrollbar): fix scrollbar. Fixes folke#759. Fixes folke#727
  chore(main): release 4.2.2 (folke#858)
  chore(build): auto-generate vimdoc
  fix(hover): ignore invalid markup. Fixes folke#819
  fix(msg): clear existing confirm messages. Fixes folke#302
  chore(main): release 4.2.1 (folke#857)
  chore(build): auto-generate vimdoc
  fix(cmdline): only use cmdline_input for short prompts without newline. Fixes folke#856
  chore(main): release 4.2.0 (folke#850)
  chore(build): auto-generate vimdoc
  fix(cmdline): allow overriding title hl
  fix(cmdline): reset title when needed
  chore(build): auto-generate vimdoc
  fix(nui): redo layout when border changes
  fix(cmdline_input): put in same position as cmdline_popup
  feat(cmdline): icon for cmdline input
  fix(fzf): message id
  feat(cmdline): use cmdline prompt as title. Noice is now great for vim.ui.input out of the box
  ...
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

Successfully merging a pull request may close this issue.

2 participants