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

nvim-tree does not allow renaming the file even with changed letter capitalization #2813

Open
samueldurantes opened this issue Jun 28, 2024 · 8 comments
Labels
bug Something isn't working OS Windows PowerShell specific to windows powershell OS Windows WSL specific to windows WSL OS Windows specific to windows PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated

Comments

@samueldurantes
Copy link
Contributor

samueldurantes commented Jun 28, 2024

Description

I'm trying to rename a file by changing the first letter from lowercase to uppercase, but I'm getting an error that says the file cannot be renamed because it already exists.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1710088188

Operating system and version

macOS 14.3

Windows variant

No response

nvim-tree version

2086e56

Clean room replication

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

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

-- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate.
-- Requires diagnostics.enable = true in setup.
--[[
vim.api.nvim_create_autocmd("FileType", {
  pattern = "lua",
  callback = function()
    vim.lsp.start { cmd = { "lua-language-server" } }
  end,
})
]]

Steps to reproduce

  1. mkdir test
  2. cd test
  3. touch test.js
  4. nvim -nu /tmp/nvt-min.lua
  5. :NvimTreeOpen
  6. Press r to rename the file.
  7. Rename the file to Test.js

Expected behavior

It should be possible to rename the file test.js to Test.js without considering case sensitivity.

Actual behavior

Screen.Recording.2024-06-28.at.17.37.02.mov
@samueldurantes samueldurantes added the bug Something isn't working label Jun 28, 2024
@gegoune
Copy link
Collaborator

gegoune commented Jul 1, 2024

See :help nvim-tree-os-specific.

@samueldurantes
Copy link
Contributor Author

See :help nvim-tree-os-specific.

This command doesn't exist on my Neovim.

image

@huyhoang8398

This comment has been minimized.

alex-courtis added a commit that referenced this issue Jul 11, 2024
…2814)

* fix(#2813): enable file renaming in `nvim-tree` with changed capitalization

* fix(#2813): check if is macos

---------

Co-authored-by: Alexander Courtis <[email protected]>
@samueldurantes
Copy link
Contributor Author

I'm closing this, because the PR that fixed this was merged #2814

@alex-courtis
Copy link
Member

I'm closing this, because the PR that fixed this was merged #2814

Thank you!

@itsramiel

This comment has been minimized.

@qiyuewuyi2333
Copy link

Still doesn't work for windows11

@alex-courtis
Copy link
Member

Still doesn't work for windows11

The fix is macos specific; :help nvim-tree-os-specific appears to be out of date.

nvim-tree team have no access to nor expertise with windows. Please do create the PR, see CONTRIBUTING.md

I think that specific fixes for powershell and WSL will be required, see wiki: OS feature flags

@alex-courtis alex-courtis reopened this Dec 6, 2024
@alex-courtis alex-courtis added OS Windows WSL specific to windows WSL PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated OS Windows PowerShell specific to windows powershell OS Windows specific to windows labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS Windows PowerShell specific to windows powershell OS Windows WSL specific to windows WSL OS Windows specific to windows PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated
Projects
None yet
Development

No branches or pull requests

6 participants