-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Incorrect Parent Folder Name When Moving Folders #357
Comments
I believe this was fixed not too long ago. Can you update telescope-file-browser and see if the issue still persists? |
Hi @jamestrew, Thanks for investigating the issue. I wanted to let you know that I've updated the telescope-file-browser plugin, and you can verify the changes in the Git log below:
However, I regret to inform you that the issue is not yet resolved on my end. If you have any insights or suggestions, I would greatly appreciate your assistance. |
Can you provide more details on how to reproduce this.
with the minimal config and I'm not getting any strange behaviors. file-browser-move-folder-repro.mp4 |
I hope this message finds you well. I wanted to update you on the situation regarding the issue we discussed. I attempted to resolve it by cleaning up my Neovim configurations using the following steps:
Afterwards, I created a new ~/.config/nvim/init.lua from here file with the following content:
and another ~/.config/nvim/min.lua
I then tested the setup using:
s.mp4However, it did not work as expected. If you have any insights or suggestions on how to resolve this, I would greatly appreciate your assistance. Thank you for your time and help. |
I'm sorry. I tried to follow exactly your steps, even downgraded to neovim v0.9.4 but I'm still not able to replicate this issue. |
Thank you for your continued efforts in trying to help me resolve this issue. I've done some tracking down on my end, and it seems that the problem might be related to the line: |
Interesting. vim.print {
selection = old_path_absolute,
basename = basename,
target_dir = target_dir,
new_path = new_path_absolute,
} below that line
then repeat the reproduction steps and share the results? I don't think it's the |
Thanks for your suggestion. I've added the debug print statements below the line:
|
Wow. I'm thoroughly confused. local target_dir = get_target_dir(finder)
local moved = {}
local skipped = {}
for idx, selection in ipairs(selections) do
local old_path_absolute = selection:absolute()
print(old_path_absolute)
if vim.fn.isdirectory(old_path_absolute) == 1 then
old_path_absolute = vim.fs.dirname(old_path_absolute)
end
local basename = vim.fs.basename(old_path_absolute)
print(basename, old_path_absolute) And just to double check, nothing but the print statements should be different here. |
I've confirmed that using Tab key to select, delete, and copy directories works as expected. However, I've also tested this in WSL Ubuntu on Windows 10, and I'm encountering the same unexpected results when moving directories.
|
Ohhh I see what the issue is and why I couldn't reproduce it. I'll work on a fix for this. Thanks for helping me debug this. |
@fadedreams If you can try out the linked PR, that would be great. |
You're correct; I haven't installed fd. However, I tested the linked PR 358, and it worked for me in the situation even without installing fd. Thanks for your quick response and efforts to fix the issue! |
Description
I have encountered a potential issue when using the telescope-file-browser.nvim plugin. When I mark a folder for moving, navigate to another folder, and then press Alt + m to move the marked folder, the moved folder's name becomes the parent of the desired folder instead of retaining its original name.
Neovim version
Operating system and version
Debian12
Steps to reproduce
Expected behavior
I expect the marked folder to be moved to the current location, the moved folder should be keep its original name.
Actual behavior
The moved folder's name becomes the parent of the desired folder.
Minimal config
The text was updated successfully, but these errors were encountered: