updated for version 7.2a
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
" Vim Plugin: Edit the file with an existing Vim if possible
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Last Change: 2007 Mar 17
|
||||
" Last Change: 2008 May 29
|
||||
|
||||
" This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32)
|
||||
" $VIM/vimfiles/plugin directory. Or make a symbolic link, so that you
|
||||
@ -13,6 +13,9 @@
|
||||
" 2. When a file is edited and a swap file exists for it, try finding that
|
||||
" other Vim and bring it to the foreground. Requires Vim 7, because it
|
||||
" uses the SwapExists autocommand event.
|
||||
if v:version < 700
|
||||
finish
|
||||
endif
|
||||
|
||||
" Function that finds the Vim instance that is editing "filename" and brings
|
||||
" it to the foreground.
|
||||
@ -102,8 +105,10 @@ func! EditExisting(fname, command)
|
||||
|
||||
if winnr > 0
|
||||
exe winnr . "wincmd w"
|
||||
elseif exists('*fnameescape')
|
||||
exe "split " . fnameescape(a:fname)
|
||||
else
|
||||
exe "split " . escape(a:fname, ' #%"|')
|
||||
exe "split " . escape(a:fname, " \t\n*?[{`$\\%#'\"|!<")
|
||||
endif
|
||||
|
||||
if a:command != ''
|
||||
|
||||
Reference in New Issue
Block a user