Skip to content

Parent folder deleted when deleting a folder starting with $ #2733

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
sleewoo opened this issue Mar 30, 2024 · 4 comments · Fixed by #2735
Closed

Parent folder deleted when deleting a folder starting with $ #2733

sleewoo opened this issue Mar 30, 2024 · 4 comments · Fixed by #2735
Labels
bug Something isn't working reproduced Issue confirmed

Comments

@sleewoo
Copy link

sleewoo commented Mar 30, 2024

Description

If deleted folder starts with $ then parent folder deleted instead!

In video trying delete api/$crud but whole api deleted instead!

Peek.2024-03-30.23-10.mp4

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

Operating system and version

Linux 6.5.13-7-MANJARO x86_64

Windows variant

No response

nvim-tree version

ddd1d6e

Clean room replication

my lazy config:

  {
    "nvim-tree/nvim-tree.lua",
    cmd = {
      "NvimTreeOpen",
      "NvimTreeClose",
      "NvimTreeToggle",
      "NvimTreeFindFile",
      "NvimTreeFindFileToggle",
    },
    keys = {
      { "<leader>e", "<cmd>lua require('nvim-tree.api').tree.toggle()<cr>", desc = "Tree" },
    },
    config = function()
      require("nvim-tree").setup()
    end
  }

Steps to reproduce

mkdir api/\$crud
nvim

open tree and delete $crud inside api folder

Expected behavior

should delete $crud folder

Actual behavior

it is deleting whole api folder

@sleewoo sleewoo added the bug Something isn't working label Mar 30, 2024
alex-courtis added a commit that referenced this issue Mar 31, 2024
@alex-courtis
Copy link
Member

Reproduced for trash, not for delete.

I'd be grateful if you tested a fix #2735

cd /path/to/nvim-tree.lua
git pull
git checkout 2733-escape-trash-path

When you're finished testing:

git checkout master

@alex-courtis alex-courtis added the reproduced Issue confirmed label Mar 31, 2024
alex-courtis added a commit that referenced this issue Mar 31, 2024
@sleewoo
Copy link
Author

sleewoo commented Apr 1, 2024

just tested 2733-escape-trash-path branch and it works as expected.
thanks for quick resolution.

alex-courtis added a commit that referenced this issue Apr 2, 2024
@alex-courtis
Copy link
Member

Apologies @sleewoo : on consideration I made a further change: #2735 (comment)

I'd be most grateful if you could test again.

@sleewoo
Copy link
Author

sleewoo commented Apr 2, 2024

@alex-courtis
tested new commit, works perfect,
thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working reproduced Issue confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants