diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-12-16 21:49:31 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-12-16 21:49:31 +0000 |
commit | 12033fb4bfa58447ba89104ff671a076e756b8e6 (patch) | |
tree | 3a109c25124eea7e67e2b2a6a02db9db18bb7a2c /runtime/macros | |
parent | bca84a12bdbb4bb33e9ba32bfe320abbf54ae5fb (diff) | |
download | vim-git-12033fb4bfa58447ba89104ff671a076e756b8e6.tar.gz |
updated for version 7.0171
Diffstat (limited to 'runtime/macros')
-rw-r--r-- | runtime/macros/editexisting.vim | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/runtime/macros/editexisting.vim b/runtime/macros/editexisting.vim index 2f28874aa..b062c5b22 100644 --- a/runtime/macros/editexisting.vim +++ b/runtime/macros/editexisting.vim @@ -1,9 +1,10 @@ " Vim Plugin: Edit the file with an existing Vim if possible " Maintainer: Bram Moolenaar -" Last Change: 2005 Dec 11 +" Last Change: 2005 Dec 15 " This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32) -" $VIM/vimfiles/plugin directory. +" $VIM/vimfiles/plugin directory. Or make a symbolic link, so that you +" automatically use the latest version. " This plugin serves two purposes: " 1. On startup, if we were invoked with one file name argument and the file @@ -43,13 +44,15 @@ func s:EditElsewhere(filename) endif call remote_expr(servername, "foreground()") - " Make sure the file is visible in a window (not hidden). - " If v:swapcommand exists and is set, send it to the server. - if exists("v:swapcommand") - let c = substitute(v:swapcommand, "'", "''", "g") - call remote_expr(servername, "EditExisting('" . fname_esc . "', '" . c . "')") - else - call remote_expr(servername, "EditExisting('" . fname_esc . "', '')") + if remote_expr(servername, "exists('*EditExisting')") + " Make sure the file is visible in a window (not hidden). + " If v:swapcommand exists and is set, send it to the server. + if exists("v:swapcommand") + let c = substitute(v:swapcommand, "'", "''", "g") + call remote_expr(servername, "EditExisting('" . fname_esc . "', '" . c . "')") + else + call remote_expr(servername, "EditExisting('" . fname_esc . "', '')") + endif endif if !(has('vim_starting') && has('gui_running') && has('gui_win32')) |