Over ssh
the netrw
browsing window cannot go up (tries to open a non-existing file).
The s:NetrwBrowse()
function requires a:
https://github.com/vim/vim/blob/f165798184dc03895709704df864bd1e43eaf09f/runtime/pack/dist/opt/netrw/autoload/netrw.vim#L3034
for remote files that is missing in this case.
The pull request merely restores the old behaviour as fix:
https://github.com/vim/vim/blob/223189389a18acf6e074ab0ca1a3bb6a4ec27ef7/runtime/pack/dist/opt/netrw/autoload/netrw.vim#L3882
https://github.com/vim/vim/pull/18199
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@MiguelBarro pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@chrisbra commented on this pull request.
In runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim:
> @@ -87,7 +87,8 @@ endfunction " netrw#fs#Dirname: {{{ function netrw#fs#Dirname(path) - return netrw#fs#AbsPath(a:path)->fnamemodify(':h') + " Keep a slash as directory recognition pattern + return (a:path !~ s:slash . '$') ? a:path . s:slash : a:path
But this means we are no longer making it a full path. Should we perhaps do it like this instead?
let path = netrw#fs#AbsPath(a:path)->fnamemodify(':h') return (path !~ s:slash . '$') ? path . s:slash : a:path
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@MiguelBarro commented on this pull request.
In runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim:
> @@ -87,7 +87,8 @@ endfunction " netrw#fs#Dirname: {{{ function netrw#fs#Dirname(path) - return netrw#fs#AbsPath(a:path)->fnamemodify(':h') + " Keep a slash as directory recognition pattern + return (a:path !~ s:slash . '$') ? a:path . s:slash : a:path
That's a good point. But netrw#fs#AbsPath(a:path)
will always remove the slash, we no longer need the check:
function netrw#fs#Dirname(path)
" Keep a slash as directory recognition pattern
return netrw#fs#AbsPath(a:path) . s:slash endfunction
will do.
Note fnamemodify(':h')
must be removed because without a slash at the end it will remove the current dir. For example:
:echo "scp://ds//opt/nvidia/deepstream"->fnamemodify(':h') scp://ds//opt/nvidia :echo "scp://ds//opt/nvidia/deepstream/"->fnamemodify(':h') scp://ds//opt/nvidia/deepstream
Later the execution of:
https://github.com/vim/vim/blob/9fd1a657d2efae5cff278eb5acaa380623a50cf6/runtime/pack/dist/opt/netrw/autoload/netrw.vim#L3977-L3985
will go up another dir again...a double jump.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@MiguelBarro pushed 1 commit.
You are receiving this because you are subscribed to this thread.
okay thanks.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Reviewing #18421 I realized this PR only works properly on windows if 'shellslash'
is on (not the default).
The main issue is there are several places in the sources where the directory goes up:
dirname
no longer ends in /
.As was revamp:
/
ending)./
/
.After this PR B never goes updir and A does the job again ... at least if 'shellslash
' is on.
If 'shellslash
' is off (default) then A fails because dirname
ends in `' instead.
The fix is not as easy as using /
in netrw#fs#Dirname()
because the A regex expect all separators to be /
.
The easiest workaround is normalizing all path separators to /
before using the regexp or modify the regexp to cope with any separator.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.