-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
- broken under Vim >= 9.0 ? #136
Comments
The issue persists under Vim 9.1.151 and (autoload) netrw (from 2024 Feb 29) |
The only workaround I could come up with is temporarily switching to the file's dir, such as adding nnoremap <silent> <SID>(lcd) :<c-u>lcd %:p:h<CR>
nmap <silent> - <SID>(lcd)<Plug>VinegarUp or, to restore the current work dir, nnoremap <silent> - :<c-u>call <SID>VinegarUp()<CR>
fun s:VinegarUp()
let save_dir = chdir(expand('%:p:h'))
if !empty(save_dir)
exe "normal \<Plug>VinegarUp"
call chdir(save_dir)
endif
endf to |
serebrov
added a commit
to serebrov/vim-vinegar
that referenced
this issue
Jun 28, 2024
Recently it does not always work. Sometimes pressing "-" opens the parent directory with the cursor on the first line instead of the current file line. The actual problem is that the alternative buffer name is empty after going to the netrw buffer and `expand('#:t')` returns empty string. This change fixes it by saving the curren file name before opening the netrw buffer. Note that underlying issue is not solved: the alternative buffer is still empty, so Ctrl-6 to go back still does not work. Related to tpope#136
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using Vim 9.0.2103 under Linux with
netrwPlugin.vim
fromFeb 09, 2021
.Typing
with
~/.viminrc
readingthen
shows the cursor at the first line instead of
README.markdown
.The text was updated successfully, but these errors were encountered: