-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
The file path returned by the yank:path
contains too many backslashes.
#391
Comments
I have tried #392 in the following ways. I am not familiar with how to use the Pull Request as my plugin. (I use Powershell)
> cd ~\Git
> git clone https://github.com/lambdalisue/fern.vim.git
> cd ~\Git\fern.vim\
> gh pr checkout 392
(I use vim-plug to install fern.vim)
> rm -Recurse ~\.vim\plugged\fern.vim
> cp -Recurse ~\Git\fern.vim ~\.vim\plugged\fern.vim Then I tried again |
It seems you properly use the PR version. |
I'm not sure that the information below will help you modify your code,
From the above results, it seems that unlike the |
It seems --- a/autoload/fern/scheme/file/provider.vim
+++ b/autoload/fern/scheme/file/provider.vim
@@ -118,7 +118,7 @@ endif
if s:is_windows
let s:windows_drive_nodes = fern#scheme#file#util#list_drives(s:CancellationToken.none)
- \.then(s:AsyncLambda.map_f({ v -> s:safe(funcref('s:node', [v . '\'])) }))
+ \.then(s:AsyncLambda.map_f({ v -> s:safe(funcref('s:node', [v])) }))
\.then(s:AsyncLambda.filter_f({ v -> !empty(v) }))
endif
--- a/autoload/fern/scheme/file/util.vim
+++ b/autoload/fern/scheme/file/util.vim
@@ -36,8 +36,9 @@ if exists('*readdir')
function! fern#scheme#file#util#list_entries_readdir(path, ...) abort
let l:Profile = fern#profile#start('fern#scheme#file#util#list_entries_readdir')
let s = s:is_windows ? '\' : '/'
- return s:Promise.resolve(readdir(a:path))
- \.then(s:AsyncLambda.map_f({ v -> a:path . s . v }))
+ let path = a:path . (a:path[-1:] ==# s ? '' : s)
+ return s:Promise.resolve(readdir(path))
+ \.then(s:AsyncLambda.map_f({ v -> path . v }))
\.finally({ -> Profile() })
endfunction
endif This patch may fix the issue (thanks to @ichizok on vim-jp Slack https://vim-jp.slack.com/archives/CLKR04BEF/p1644392038457259) I need to investigate it. |
That's great! |
Describe the bug:
When I select a child node and use
yank:path
with Drives orC:\
displayed in the root directory,the file path returned by
yank:path
contains too many backslashes in the part immediately after the drive name.If there is no Drives or
C:\
in the root directory, the file path returned byyank:path
is normal.yank:path
resultyank:path
resultC:\
C:\\
C:\parent\child
C:\\\parent\child
C:\
C:\
C:\
C:\
C:\parent\child
C:\\parent\child
C:\parent
C:\parent\child
C:\parent\child
Environment:
OS: Windows11 Version 10.0.22000.434
Terminal: Windows Terminal 1.12.10334.0
Vim: NVIM v0.6.1
To Reproduce:
Case 1:
:Fern /
.C:\
displayed in the root directory.C:\parent\child
) and useyank:path
.C:\\parent\child
yanked.Case 2:
:Fern /
.C:\
displayed in the root directory.<C-h>
,leave
action invoke.Drives
displayed in the root directory.C:\parent\child
) and useyank:path
.C:\\\parent\child
yanked.Expected behavior:
Only one backslash should appear in the part of the file path immediately after the drive name.
Additional Context:
When I select the child node I described above and run
rename
,the file path displayed as the rename target also shows too many backslashes, just like this issue.
However, even if I execute rename with too many backslashes in the file path, the rename will be completed without any problem.
This behavior is probably related to the above issue, so I will describe it here.
The text was updated successfully, but these errors were encountered: