summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-03-18 20:51:46 +0000
committerBram Moolenaar <Bram@vim.org>2007-03-18 20:51:46 +0000
commit867a4b7630a0a35559611661d87689640ed39b80 (patch)
tree4478ed4b900c1e1f9f8ff6272b060113db299c47
parent49104e4038b2347692d15e1a3c30abdc4378f9cf (diff)
downloadvim-git-867a4b7630a0a35559611661d87689640ed39b80.tar.gz
updated for version 7.0-219v7.0.219
-rw-r--r--runtime/macros/editexisting.vim22
-rw-r--r--src/main.c20
-rw-r--r--src/version.c2
3 files changed, 40 insertions, 4 deletions
diff --git a/runtime/macros/editexisting.vim b/runtime/macros/editexisting.vim
index f0feed08f..fb6b9193f 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: 2006 Apr 30
+" Last Change: 2007 Mar 17
" 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
@@ -85,9 +85,23 @@ endtry
" Function used on the server to make the file visible and possibly execute a
" command.
func! EditExisting(fname, command)
- let n = bufwinnr(a:fname)
- if n > 0
- exe n . "wincmd w"
+ " Get the window number of the file in the current tab page.
+ let winnr = bufwinnr(a:fname)
+ if winnr <= 0
+ " Not found, look in other tab pages.
+ let bufnr = bufnr(a:fname)
+ for i in range(tabpagenr('$'))
+ if index(tabpagebuflist(i + 1), bufnr) >= 0
+ " Make this tab page the current one and find the window number.
+ exe 'tabnext ' . (i + 1)
+ let winnr = bufwinnr(a:fname)
+ break;
+ endif
+ endfor
+ endif
+
+ if winnr > 0
+ exe winnr . "wincmd w"
else
exe "split " . escape(a:fname, ' #%"|')
endif
diff --git a/src/main.c b/src/main.c
index 3c37698df..c0b8b25b9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -798,6 +798,11 @@ main
create_windows(&params);
TIME_MSG("opening buffers");
+#ifdef FEAT_EVAL
+ /* clear v:swapcommand */
+ set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
+#endif
+
/* Ex starts at last line of the file */
if (exmode_active)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
@@ -2202,6 +2207,21 @@ scripterror:
argv_idx = 1;
}
}
+
+#ifdef FEAT_EVAL
+ /* If there is a "+123" or "-c" command, set v:swapcommand to the first
+ * one. */
+ if (parmp->n_commands > 0)
+ {
+ p = alloc((unsigned)STRLEN(parmp->commands[0]) + 3);
+ if (p != NULL)
+ {
+ sprintf((char *)p, ":%s\r", parmp->commands[0]);
+ set_vim_var_string(VV_SWAPCOMMAND, p, -1);
+ vim_free(p);
+ }
+ }
+#endif
}
/*
diff --git a/src/version.c b/src/version.c
index 84450a85c..d58ae293b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 219,
+/**/
218,
/**/
217,