derekwyatt / vim-fswitch

Vim plug for switching between companion source files (e.g. ".h" and ".cpp")
179 stars 57 forks source link

Fix problem with opening symlink buffers #11

Open wilywampa opened 9 years ago

wilywampa commented 9 years ago

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().