Skip to content

cut paste overwrite throws when both files open #1989

Closed
@alex-courtis

Description

@alex-courtis

Description

cut paste overwrite throws when both files open

Neovim version

NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

Linux 6.1.9-arch1-1

nvim-tree version

b712b82

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
end

Steps to reproduce

touch a A
nvim -nu /tmp/nvt-min.lua
open a and A
cut A
paste A overwriting a

Expected behavior

No response

Actual behavior

E5108: Error executing lua: ...t-dev/site/pack/packer/start/dev/lua/nvim-tree/utils.lua:166: Failed to rename buffer
stack traceback:
        [C]: in function 'nvim_buf_set_name'
        ...t-dev/site/pack/packer/start/dev/lua/nvim-tree/utils.lua:166: in function 'rename_loaded_buffers'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:193: in function 'action_fn'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:89: in function 'on_process'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:102: in function 'callback'
        ...nvt-dev/site/pack/packer/start/dev/lua/nvim-tree/lib.lua:148: in function 'on_confirm'
        /usr/share/nvim/runtime/lua/vim/ui.lua:93: in function 'input'
        ...nvt-dev/site/pack/packer/start/dev/lua/nvim-tree/lib.lua:147: in function 'prompt'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:99: in function 'do_single_paste'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:107: in function 'on_confirm'
        /usr/share/nvim/runtime/lua/vim/ui.lua:93: in function 'input'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:104: in function 'callback'
        ...nvt-dev/site/pack/packer/start/dev/lua/nvim-tree/lib.lua:148: in function 'on_confirm'
        /usr/share/nvim/runtime/lua/vim/ui.lua:93: in function 'input'
        ...nvt-dev/site/pack/packer/start/dev/lua/nvim-tree/lib.lua:147: in function 'prompt'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:99: in function 'do_single_paste'
        ...packer/start/dev/lua/nvim-tree/actions/fs/copy-paste.lua:170: in function 'handle_tree_actions'
        ...pack/packer/start/dev/lua/nvim-tree/actions/dispatch.lua:123: in function 'dispatch'
        ...ite/pack/packer/start/dev/lua/nvim-tree/actions/init.lua:273: in function <...ite/pack/packer/start/dev/lua/nvim-tree/actions/init.lua:272>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreproducedIssue confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions