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

Fix problem with opening symlink buffers #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wilywampa
Copy link

If you have a file a.h and a file a.c in a directory ./a and then create symlinks to the files in a directory ./b, then open ./a/a.h and ./b/a.c, FSwitch fails to switch between the two files with E94: No matching buffer. The solution is to use bufnr() instead of the filename for the buffer command which ensures you get the buffer number that was checked in bufexists().

slycelote added a commit to slycelote/vim-fswitch that referenced this pull request Mar 13, 2016
…l edit."

This reverts commit 8a8fa09.

The problem that it is supposed to address ("the cursor always returns
at the beginning of the file") is not specific to fswitch and can be
fixed by an autocommand in a more generic way (autocmd BufWinEnter * exe
"normal! g`\"").

On the other hand, this commit introduces two problems:
  - when switching to an unlisted buffer, it remains unlisted. This
    leads, for example, to counterintuitive behavior in buftabline (and
    probably other similar plugins): currently opened buffer is not
    in buffer list.
  - problem with opening symlink buffers (derekwyatt#11)

Reverting it solves both.
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

Successfully merging this pull request may close these issues.

1 participant