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: Noice breaks when entering %s replace mode. #707

Closed
3 tasks done
shanyssys opened this issue Jan 27, 2024 · 4 comments · Fixed by #774
Closed
3 tasks done

bug: Noice breaks when entering %s replace mode. #707

shanyssys opened this issue Jan 27, 2024 · 4 comments · Fixed by #774
Labels
bug Something isn't working

Comments

@shanyssys
Copy link

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-931f288

Operating system/version

Windows 11

Describe the bug

When entering a cmd mode with :
I want to replace text in the file using %s command.
The moment you add the character / then the quicklist window is open, showing matches, but then every character you type after the / is being screwed up and won't show. Trying to delete backward is even worse as it deletes the wrong characters.

noice.mp4

Steps To Reproduce

  1. Open a file / new buffer
  2. press : (cmd popup will show)
  3. enter %s/test/

Expected Behavior

the expected behavior is that the text should be replaced without stuttering test and missing characters.

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",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@shanyssys shanyssys added the bug Something isn't working label Jan 27, 2024
@MicheleQuasar
Copy link

MicheleQuasar commented Feb 7, 2024

I'm having the same problem; in my testing it seems that entering any replace mode, either for single line, region or whole buffer, as soon as the first / is typed what the command line displays appears to be one keystroke behind what the user is typing.

For instance, typing :s/ab displays :s/a. Same goes for deletion operations: when <backspace> is pressed nothing happens until the next keystroke when the deletion displays.

I tried playing around a bit with the config disabling some of the options in cmdline but nothing seems to help.

In my case:

Nvim version

NVIM v0.10.0-dev-2284+gf6042d5c3

Operating system

Windows 10 (build 19045.3930)

Miniamal config

local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
		"--branch=stable", -- latest stable release
		lazypath,
	})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	"folke/noice.nvim",
	event = "VeryLazy",
	dependencies = {
		"MunifTanjim/nui.nvim",
		"rcarriga/nvim-notify",
	},
})

require("noice").setup({})

@JustBarnt
Copy link

@shanyssys @MicheleQuasar Have either of you had any luck figuring out a solution or workaround for this?

@Sam-programs
Copy link
Contributor

Is this issue for the cmdline replace mode (:h c_<Insert>) ? Or is "replace mode" the substitute command ?

@JustBarnt
Copy link

I notice the issue whenever I'm doing a substitute, whether that is s/ or %s/

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.

4 participants