Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sebi2k1/vim-fswitch into …
Browse files Browse the repository at this point in the history
…sebi2k1-master
  • Loading branch information
derekwyatt committed Nov 10, 2017
2 parents e716da1 + 60d32f2 commit db92b12
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugin/fswitch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ function! FSwitch(filename, precmd)
if strlen(a:precmd) != 0
execute a:precmd
endif
if bufexists(newpath)
execute 'buffer ' . fnameescape(newpath)
let s:fname = fnameescape(newpath)

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

0 comments on commit db92b12

Please sign in to comment.