Skip to content
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

symlinks aren't resolved correctly #13

Open
cfal opened this issue Jul 26, 2022 · 0 comments
Open

symlinks aren't resolved correctly #13

cfal opened this issue Jul 26, 2022 · 0 comments

Comments

@cfal
Copy link

cfal commented Jul 26, 2022

apologies for the vague title. this happens with neovim on ubuntu 20.04 when opening files from the command line, or from inside vim (:e). i ran into this issue when using rust.vim which doesn't autosave formatted code correctly when the file path is still a symlink.

example:

mkdir test
echo "hello" > test/hello.txt
mkdir test2 && cd test2
ln -s ../test
vim test/hello.txt

:files will show:

  1 %a   "test/hello.txt"              line 1

.. which is still a symlink.

the problem seems to be:

autocmd BufRead * nested call s:on_buf_read(expand('<afile>'))

once i changed it to:

autocmd BufRead * nested call s:on_buf_read(expand('%'))

it expands correctly:

  2 %a   "../test/hello.txt"            line 1 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant