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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions plugin/fswitch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ endfunction
"
function! FSwitch(filename, precmd)
if !exists("b:fswitchdst") || strlen(b:fswitchdst) == 0
throw 'b:fswitchdst not set - read :help fswitch'
doautocmd fswitch_au_group BufEnter
endif
if (!exists("b:fswitchlocs") || strlen(b:fswitchlocs) == 0) &&
\ (!exists("b:fsdisablegloc") || b:fsdisablegloc == 0)
Expand Down Expand Up @@ -315,12 +315,10 @@ function! FSwitch(filename, precmd)
if strlen(a:precmd) != 0
execute a:precmd
endif
let s:fname = fnameescape(newpath)

if (strlen(bufname(s:fname))) > 0
execute 'buffer ' . s:fname
if bufexists(newpath)
execute 'buffer ' . bufnr(newpath)
else
execute 'edit ' . s:fname
execute 'edit ' . fnameescape(newpath)
endif
else
echoerr "Alternate has evaluated to nothing. See :h fswitch-empty for more info."
Expand Down