summaryrefslogtreecommitdiff
path: root/runtime/macros
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-06-24 21:16:56 +0000
committerBram Moolenaar <Bram@vim.org>2008-06-24 21:16:56 +0000
commit3577c6fafb77da5419cd1001dac56f204d480bdc (patch)
tree46a08e8d03068c31624359c2601b3645c2881d8c /runtime/macros
parenta7241f5f19fd0865ce697939c347a8c88fb507d5 (diff)
downloadvim-git-3577c6fafb77da5419cd1001dac56f204d480bdc.tar.gz
updated for version 7.2a
Diffstat (limited to 'runtime/macros')
-rw-r--r--runtime/macros/editexisting.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/macros/editexisting.vim b/runtime/macros/editexisting.vim
index fb6b9193f..07c55f675 100644
--- a/runtime/macros/editexisting.vim
+++ b/runtime/macros/editexisting.vim
@@ -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 != ''