summaryrefslogtreecommitdiff
path: root/src/mark.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-11-09 12:46:09 +0000
committerBram Moolenaar <Bram@vim.org>2008-11-09 12:46:09 +0000
commitd812df63003c86880c97057cfb17e3db2059a56f (patch)
tree9dee4f7222edfb2916cf9fa38d8ffde19edc5a41 /src/mark.c
parentc590f62349b39ab426217bcbe05320bf6790c909 (diff)
downloadvim-git-d812df63003c86880c97057cfb17e3db2059a56f.tar.gz
updated for version 7.2-031v7.2.031
Diffstat (limited to 'src/mark.c')
-rw-r--r--src/mark.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/mark.c b/src/mark.c
index 2adf098f5..3dddad65d 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -1627,15 +1627,17 @@ write_one_mark(fp_out, c, pos)
/*
* Handle marks in the viminfo file:
- * fp_out == NULL read marks for current buffer only
- * fp_out != NULL copy marks for buffers not in buffer list
+ * fp_out != NULL: copy marks for buffers not in buffer list
+ * fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf only
+ * fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
*/
void
-copy_viminfo_marks(virp, fp_out, count, eof)
+copy_viminfo_marks(virp, fp_out, count, eof, flags)
vir_T *virp;
FILE *fp_out;
int count;
int eof;
+ int flags;
{
char_u *line = virp->vir_line;
buf_T *buf;
@@ -1647,10 +1649,23 @@ copy_viminfo_marks(virp, fp_out, count, eof)
char_u *p;
char_u *name_buf;
pos_T pos;
+#ifdef FEAT_EVAL
+ list_T *list = NULL;
+#endif
if ((name_buf = alloc(LSIZE)) == NULL)
return;
*name_buf = NUL;
+
+#ifdef FEAT_EVAL
+ if (fp_out == NULL && (flags & (VIF_GET_OLDFILES | VIF_FORCEIT)))
+ {
+ list = list_alloc();
+ if (list != NULL)
+ set_vim_var_list(VV_OLDFILES, list);
+ }
+#endif
+
num_marked_files = get_viminfo_parameter('\'');
while (!eof && (count < num_marked_files || fp_out == NULL))
{
@@ -1681,6 +1696,11 @@ copy_viminfo_marks(virp, fp_out, count, eof)
p++;
*p = NUL;
+#ifdef FEAT_EVAL
+ if (list != NULL)
+ list_append_string(list, str, -1);
+#endif
+
/*
* If fp_out == NULL, load marks for current buffer.
* If fp_out != NULL, copy marks for buffers not in buflist.
@@ -1688,7 +1708,7 @@ copy_viminfo_marks(virp, fp_out, count, eof)
load_marks = copy_marks_out = FALSE;
if (fp_out == NULL)
{
- if (curbuf->b_ffname != NULL)
+ if ((flags & VIF_WANT_MARKS) && curbuf->b_ffname != NULL)
{
if (*name_buf == NUL) /* only need to do this once */
home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);