-
-
Notifications
You must be signed in to change notification settings - Fork 910
Description
Description
I've been using builtin.registers and have the notice the following few bugs:
-
Editing read-only registers content results in an error
-
Editing named registers content appends instead of edit.
-
Picker not updated when editing a registers value.
Neovim version
NVIM v0.11.0
Build type: Release
LuaJIT 2.1.1741730670
Operating system and version
Debian Testing
Telescope version / branch / rev
telescope / master / latest
checkhealth telescope
==============================================================================
telescope: health#telescope#check
Checking for required plugins
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies
- OK rg: found ripgrep 14.1.1
- OK fd: found fdfind 10.2.0
===== Installed extensions =====
Steps to reproduce
-
- Save data to a register, e.g.: "ayy
- :Telescope registers
- Select a read-only register (e.g.: ".", "%" or ":")
- to edit the register, enter new value,
2-3.
- Save data to a register, e.g.: "ayy
- :Telescope registers
- Select the register (e.g. "a")
- to edit the register, enter new value,
Expected behavior
- Attempting to edit read-only registers should be ignored
- Editing named registers should use the lowercase letters to replace instead of append
- Picker should be refreshed after editing a register
Actual behavior
- Editing read-only registers content results in an error
Three registers are read-only ":, ". and "% which result in the following error if one attempts to edit them:
Edit [:] ❯ Telescope registersaE5108: Error executing lua: Vim:E354: Invalid register name: ':'
stack traceback:
[C]: in function 'setreg'
.../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:454: in function 'run_replace_or_original'
...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:293: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:292>
- Editing named registers content appends instead of edit.
Editing any of the named registers (a-z) is one with the uppercase letter (A-Z) which results in the edited content to be added to the existing content. This is due to the default behaviour of using the uppercase version of the letter when setting the register value (see :h quote_alpha)
- Picker not updated when editing a registers value.
After editing a register value the picker is not updated and shows the old value until the picker is closed and open again.
Minimal config
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.uv.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 = {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
-- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
require("telescope").setup {}
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})