*** ../vim-7.2.018/runtime/doc/cmdline.txt Sat Aug 9 19:36:46 2008 --- runtime/doc/cmdline.txt Sun Sep 14 13:40:34 2008 *************** *** 730,748 **** In Ex commands, at places where a file name can be used, the following characters have a special meaning. These can also be used in the expression function expand() |expand()|. ! % is replaced with the current file name *:_%* ! # is replaced with the alternate file name *:_#* #n (where n is a number) is replaced with the file name of ! buffer n. "#0" is the same as "#" ! ## is replaced with all names in the argument list *:_##* concatenated, separated by spaces. Each space in a name is preceded with a backslash. ! Note that these give the file name as it was typed. If an absolute path is ! needed (when using the file name from a different directory), you need to add ! ":p". See |filename-modifiers|. Note that backslashes are inserted before spaces, so that the command will correctly interpret the file name. But this doesn't happen for shell ! commands. For those you probably have to use quotes: > :!ls "%" :r !spell "%" --- 735,763 ---- In Ex commands, at places where a file name can be used, the following characters have a special meaning. These can also be used in the expression function expand() |expand()|. ! % Is replaced with the current file name. *:_%* *c_%* ! # Is replaced with the alternate file name. *:_#* *c_#* #n (where n is a number) is replaced with the file name of ! buffer n. "#0" is the same as "#". ! ## Is replaced with all names in the argument list *:_##* *c_##* concatenated, separated by spaces. Each space in a name is preceded with a backslash. ! # :!ls "%" :r !spell "%" *** ../vim-7.2.018/runtime/doc/eval.txt Sat Aug 9 19:36:47 2008 --- runtime/doc/eval.txt Sun Sep 14 13:38:03 2008 *************** *** 1484,1489 **** --- 1484,1500 ---- This is the screen column number, like with |virtcol()|. The value is zero when there was no mouse button click. + *v:oldfiles* *oldfiles-variable* + v:oldfiles List of file names that is loaded from the |viminfo| file on + startup. These are the files that Vim remembers marks for. + The length of the List is limited by the ' argument of the + 'viminfo' option (default is 100). + Also see |:oldfiles| and |c_#<|. + The List can be modified, but this has no effect on what is + stored in the |viminfo| file later. If you use values other + than String this will cause trouble. + {only when compiled with the +viminfo feature} + *v:operator* *operator-variable* v:operator The last operator given in Normal mode. This is a single character except for commands starting with or , *** ../vim-7.2.018/runtime/doc/starting.txt Sat Aug 9 19:36:52 2008 --- runtime/doc/starting.txt Sun Sep 14 13:47:15 2008 *************** *** 1337,1344 **** *viminfo-read* When Vim is started and the 'viminfo' option is non-empty, the contents of the viminfo file are read and the info can be used in the appropriate places. ! The marks are not read in at startup (but file marks are). See ! |initialization| for how to set the 'viminfo' option upon startup. *viminfo-write* When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo --- 1344,1352 ---- *viminfo-read* When Vim is started and the 'viminfo' option is non-empty, the contents of the viminfo file are read and the info can be used in the appropriate places. ! The |v:oldfiles| variable is filled. The marks are not read in at startup ! (but file marks are). See |initialization| for how to set the 'viminfo' ! option upon startup. *viminfo-write* When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo *************** *** 1372,1377 **** --- 1380,1387 ---- that start with any string given with the "r" flag in 'viminfo'. This can be used to avoid saving marks for files on removable media (for MS-DOS you would use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:"). + The |v:oldfiles| variable is filled with the file names that the viminfo file + has marks for. *viminfo-file-marks* Uppercase marks ('A to 'Z) are stored when writing the viminfo file. The *************** *** 1429,1435 **** converted. ! MANUALLY READING AND WRITING Two commands can be used to read and write the viminfo file manually. This can be used to exchange registers between two running Vim programs: First --- 1439,1445 ---- converted. ! MANUALLY READING AND WRITING *viminfo-read-write* Two commands can be used to read and write the viminfo file manually. This can be used to exchange registers between two running Vim programs: First *************** *** 1463,1470 **** *:rv* *:rviminfo* *E195* :rv[iminfo][!] [file] Read from viminfo file [file] (default: see above). If [!] is given, then any information that is ! already set (registers, marks, etc.) will be ! overwritten. {not in Vi} *:wv* *:wviminfo* *E137* *E138* *E574* :wv[iminfo][!] [file] Write to viminfo file [file] (default: see above). --- 1473,1480 ---- *:rv* *:rviminfo* *E195* :rv[iminfo][!] [file] Read from viminfo file [file] (default: see above). If [!] is given, then any information that is ! already set (registers, marks, |v:oldfiles|, etc.) ! will be overwritten {not in Vi} *:wv* *:wviminfo* *E137* *E138* *E574* :wv[iminfo][!] [file] Write to viminfo file [file] (default: see above). *************** *** 1479,1482 **** --- 1489,1498 ---- the .viminfo file. {not in Vi} + *:ol* *:oldfiles* + :ol[dfiles] List the files that have marks stored in the viminfo + file. This list is read on startup and only change + afterwards with ":rviminfo!". Also see |v:oldfiles|. + {not in Vi, only when compiled with the +eval feature} + vim:tw=78:ts=8:ft=help:norl: *** ../vim-7.2.018/runtime/doc/usr_21.txt Sat Aug 9 19:36:53 2008 --- runtime/doc/usr_21.txt Sun Sep 14 14:36:54 2008 *************** *** 153,159 **** to be lost. Each item can be remembered only once. ! GETTING BACK TO WHERE YOU WERE You are halfway editing a file and it's time to leave for holidays. You exit Vim and go enjoy yourselves, forgetting all about your work. After a couple --- 153,159 ---- to be lost. Each item can be remembered only once. ! GETTING BACK TO WHERE YOU STOPPED You are halfway editing a file and it's time to leave for holidays. You exit Vim and go enjoy yourselves, forgetting all about your work. After a couple *************** *** 168,173 **** --- 168,199 ---- The |:marks| command is useful to find out where '0 to '9 will take you. + GETTING BACK TO SOME FILE + + If you want to go back to a file that you edited recently, but not when + exiting Vim, there is a slightly more complicated way. You can see a list of + files by typing the command: > + + :oldfiles + < 0: ~/.viminfo ~ + 1: ~/text/resume.txt ~ + 2: /tmp/draft ~ + + Now you would like to edit the second file, which is in the list preceded by + "1:". You type: > + + :e #<1 + + Instead of ":e" you can use any command that has a file name argument, the + "#<1" item works in the same place as "%" (current file name) and "#" + (alternate file name). So you can also split the window to edit the third + file: > + + :split #<2 + + More info at |:oldfiles|, |v:oldfiles| and |c_#<|. + + MOVE INFO FROM ONE VIM TO ANOTHER You can use the ":wviminfo" and ":rviminfo" commands to save and restore the *** ../vim-7.2.018/src/eval.c Wed Sep 10 15:38:13 2008 --- src/eval.c Sun Sep 14 21:57:38 2008 *************** *** 348,353 **** --- 348,354 ---- {VV_NAME("mouse_col", VAR_NUMBER), 0}, {VV_NAME("operator", VAR_STRING), VV_RO}, {VV_NAME("searchforward", VAR_NUMBER), 0}, + {VV_NAME("oldfiles", VAR_LIST), 0}, }; /* shorthand */ *************** *** 355,360 **** --- 356,362 ---- #define vv_nr vv_di.di_tv.vval.v_number #define vv_float vv_di.di_tv.vval.v_float #define vv_str vv_di.di_tv.vval.v_string + #define vv_list vv_di.di_tv.vval.v_list #define vv_tv vv_di.di_tv /* *************** *** 426,432 **** static long list_idx_of_item __ARGS((list_T *l, listitem_T *item)); static void list_append __ARGS((list_T *l, listitem_T *item)); static int list_append_tv __ARGS((list_T *l, typval_T *tv)); - static int list_append_string __ARGS((list_T *l, char_u *str, int len)); static int list_append_number __ARGS((list_T *l, varnumber_T n)); static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item)); static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef)); --- 428,433 ---- *************** *** 845,852 **** p = &vimvars[i]; if (p->vv_di.di_tv.v_type == VAR_STRING) { ! vim_free(p->vv_di.di_tv.vval.v_string); ! p->vv_di.di_tv.vval.v_string = NULL; } } hash_clear(&vimvarht); --- 846,858 ---- p = &vimvars[i]; if (p->vv_di.di_tv.v_type == VAR_STRING) { ! vim_free(p->vv_string); ! p->vv_string = NULL; ! } ! else if (p->vv_di.di_tv.v_type == VAR_LIST) ! { ! list_unref(p->vv_list); ! p->vv_list = NULL; } } hash_clear(&vimvarht); *************** *** 6057,6062 **** --- 6063,6087 ---- } /* + * Get list item "l[idx]" as a string. Returns NULL for failure. + */ + char_u * + list_find_str(l, idx) + list_T *l; + long idx; + { + listitem_T *li; + + li = list_find(l, idx); + if (li == NULL) + { + EMSGN(_(e_listidx), idx); + return NULL; + } + return get_tv_string(&li->li_tv); + } + + /* * Locate "item" list "l" and return its index. * Returns -1 when "item" is not in the list. */ *************** *** 6147,6153 **** * When "len" >= 0 use "str[len]". * Returns FAIL when out of memory. */ ! static int list_append_string(l, str, len) list_T *l; char_u *str; --- 6172,6178 ---- * When "len" >= 0 use "str[len]". * Returns FAIL when out of memory. */ ! int list_append_string(l, str, len) list_T *l; char_u *str; *************** *** 6507,6512 **** --- 6532,6540 ---- set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID); } + /* v: vars */ + set_ref_in_ht(&vimvarht, copyID); + /* * 2. Go through the list of dicts and free items without the copyID. */ *************** *** 6597,6603 **** { case VAR_DICT: dd = tv->vval.v_dict; ! if (dd->dv_copyID != copyID) { /* Didn't see this dict yet. */ dd->dv_copyID = copyID; --- 6625,6631 ---- { case VAR_DICT: dd = tv->vval.v_dict; ! if (dd != NULL && dd->dv_copyID != copyID) { /* Didn't see this dict yet. */ dd->dv_copyID = copyID; *************** *** 6607,6613 **** case VAR_LIST: ll = tv->vval.v_list; ! if (ll->lv_copyID != copyID) { /* Didn't see this list yet. */ ll->lv_copyID = copyID; --- 6635,6641 ---- case VAR_LIST: ll = tv->vval.v_list; ! if (ll != NULL && ll->lv_copyID != copyID) { /* Didn't see this list yet. */ ll->lv_copyID = copyID; *************** *** 18106,18111 **** --- 18134,18150 ---- } /* + * Get List v: variable value. Caller must take care of reference count when + * needed. + */ + list_T * + get_vim_var_list(idx) + int idx; + { + return vimvars[idx].vv_list; + } + + /* * Set v:count, v:count1 and v:prevcount. */ void *************** *** 18141,18146 **** --- 18180,18199 ---- } /* + * Set List v: variable to "val". + */ + void + set_vim_var_list(idx, val) + int idx; + list_T *val; + { + list_unref(vimvars[idx].vv_list); + vimvars[idx].vv_list = val; + if (val != NULL) + ++val->lv_refcount; + } + + /* * Set v:register if needed. */ void *************** *** 21900,21905 **** --- 21953,21988 ---- } } + /* + * List v:oldfiles in a nice way. + */ + /*ARGSUSED*/ + void + ex_oldfiles(eap) + exarg_T *eap; + { + list_T *l = vimvars[VV_OLDFILES].vv_list; + listitem_T *li; + int nr = 0; + + if (l == NULL) + msg((char_u *)_("No old files")); + else + { + msg_start(); + msg_scroll = TRUE; + for (li = l->lv_first; li != NULL && !got_int; li = li->li_next) + { + msg_putchar('\n'); + msg_outnum((long)nr++); + MSG_PUTS(": "); + msg_outtrans(get_tv_string(&li->li_tv)); + out_flush(); /* output one line at a time */ + ui_breakcheck(); + } + } + } + #endif /* FEAT_EVAL */ *** ../vim-7.2.018/src/ex_cmds.c Sun Sep 14 21:40:26 2008 --- src/ex_cmds.c Sun Sep 14 13:45:03 2008 *************** *** 24,30 **** static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out)); #ifdef FEAT_VIMINFO static char_u *viminfo_filename __ARGS((char_u *)); ! static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int want_info, int want_marks, int force_read)); static int viminfo_encoding __ARGS((vir_T *virp)); static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing)); #endif --- 24,30 ---- static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out)); #ifdef FEAT_VIMINFO static char_u *viminfo_filename __ARGS((char_u *)); ! static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags)); static int viminfo_encoding __ARGS((vir_T *virp)); static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing)); #endif *************** *** 1676,1689 **** /* * read_viminfo() -- Read the viminfo file. Registers etc. which are already ! * set are not over-written unless force is TRUE. -- webb */ int ! read_viminfo(file, want_info, want_marks, forceit) ! char_u *file; ! int want_info; ! int want_marks; ! int forceit; { FILE *fp; char_u *fname; --- 1676,1687 ---- /* * read_viminfo() -- Read the viminfo file. Registers etc. which are already ! * set are not over-written unless "flags" includes VIF_FORCEIT. -- webb */ int ! read_viminfo(file, flags) ! char_u *file; /* file name or NULL to use default name */ ! int flags; /* VIF_WANT_INFO et al. */ { FILE *fp; char_u *fname; *************** *** 1691,1697 **** if (no_viminfo()) return FAIL; ! fname = viminfo_filename(file); /* may set to default if NULL */ if (fname == NULL) return FAIL; fp = mch_fopen((char *)fname, READBIN); --- 1689,1695 ---- if (no_viminfo()) return FAIL; ! fname = viminfo_filename(file); /* get file name in allocated buffer */ if (fname == NULL) return FAIL; fp = mch_fopen((char *)fname, READBIN); *************** *** 1701,1708 **** verbose_enter(); smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"), fname, ! want_info ? _(" info") : "", ! want_marks ? _(" marks") : "", fp == NULL ? _(" FAILED") : ""); verbose_leave(); } --- 1699,1707 ---- verbose_enter(); smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"), fname, ! (flags & VIF_WANT_INFO) ? _(" info") : "", ! (flags & VIF_WANT_MARKS) ? _(" marks") : "", ! (flags & VIF_GET_OLDFILES) ? _(" oldfiles") : "", fp == NULL ? _(" FAILED") : ""); verbose_leave(); } *************** *** 1712,1721 **** return FAIL; viminfo_errcnt = 0; ! do_viminfo(fp, NULL, want_info, want_marks, forceit); fclose(fp); - return OK; } --- 1711,1719 ---- return FAIL; viminfo_errcnt = 0; ! do_viminfo(fp, NULL, flags); fclose(fp); return OK; } *************** *** 1968,1974 **** } viminfo_errcnt = 0; ! do_viminfo(fp_in, fp_out, !forceit, !forceit, FALSE); fclose(fp_out); /* errors are ignored !? */ if (fp_in != NULL) --- 1966,1972 ---- } viminfo_errcnt = 0; ! do_viminfo(fp_in, fp_out, forceit ? 0 : (VIF_WANT_INFO | VIF_WANT_MARKS)); fclose(fp_out); /* errors are ignored !? */ if (fp_in != NULL) *************** *** 2041,2052 **** * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo(). */ static void ! do_viminfo(fp_in, fp_out, want_info, want_marks, force_read) FILE *fp_in; FILE *fp_out; ! int want_info; ! int want_marks; ! int force_read; { int count = 0; int eof = FALSE; --- 2039,2048 ---- * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo(). */ static void ! do_viminfo(fp_in, fp_out, flags) FILE *fp_in; FILE *fp_out; ! int flags; { int count = 0; int eof = FALSE; *************** *** 2061,2068 **** if (fp_in != NULL) { ! if (want_info) ! eof = read_viminfo_up_to_marks(&vir, force_read, fp_out != NULL); else /* Skip info, find start of marks */ while (!(eof = viminfo_readline(&vir)) --- 2057,2065 ---- if (fp_in != NULL) { ! if (flags & VIF_WANT_INFO) ! eof = read_viminfo_up_to_marks(&vir, ! flags & VIF_FORCEIT, fp_out != NULL); else /* Skip info, find start of marks */ while (!(eof = viminfo_readline(&vir)) *************** *** 2092,2099 **** write_viminfo_bufferlist(fp_out); count = write_viminfo_marks(fp_out); } ! if (fp_in != NULL && want_marks) ! copy_viminfo_marks(&vir, fp_out, count, eof); vim_free(vir.vir_line); #ifdef FEAT_MBYTE --- 2089,2097 ---- write_viminfo_bufferlist(fp_out); count = write_viminfo_marks(fp_out); } ! if (fp_in != NULL ! && (flags & (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT))) ! copy_viminfo_marks(&vir, fp_out, count, eof, flags); vim_free(vir.vir_line); #ifdef FEAT_MBYTE *** ../vim-7.2.018/src/ex_cmds.h Wed Jun 25 00:44:40 2008 --- src/ex_cmds.h Sat Sep 13 18:37:25 2008 *************** *** 635,640 **** --- 635,642 ---- RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_noremap, "noremap", ex_map, BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), + EX(CMD_noautocmd, "noautocmd", ex_wrongmodifier, + NEEDARG|EXTRA|NOTRLCOM), EX(CMD_nohlsearch, "nohlsearch", ex_nohlsearch, TRLBAR|SBOXOK|CMDWIN), EX(CMD_noreabbrev, "noreabbrev", ex_abbreviate, *************** *** 651,656 **** --- 653,660 ---- EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_open, "open", ex_open, RANGE|EXTRA), + EX(CMD_oldfiles, "oldfiles", ex_oldfiles, + TRLBAR|SBOXOK|CMDWIN), EX(CMD_omap, "omap", ex_map, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_omapclear, "omapclear", ex_mapclear, *** ../vim-7.2.018/src/ex_docmd.c Sat Jul 26 16:04:39 2008 --- src/ex_docmd.c Mon Sep 15 20:04:53 2008 *************** *** 364,369 **** --- 364,370 ---- # define ex_function ex_ni # define ex_delfunction ex_ni # define ex_return ex_ni + # define ex_oldfiles ex_ni #endif static char_u *arg_all __ARGS((void)); #ifdef FEAT_SESSION *************** *** 2978,2983 **** --- 2979,2985 ---- {"keepmarks", 3, FALSE}, {"leftabove", 5, FALSE}, {"lockmarks", 3, FALSE}, + {"noautocmd", 3, FALSE}, {"rightbelow", 6, FALSE}, {"sandbox", 3, FALSE}, {"silent", 3, FALSE}, *************** *** 9506,9529 **** break; } s = src + 1; i = (int)getdigits(&s); *usedlen = (int)(s - src); /* length of what we expand */ ! buf = buflist_findnr(i); ! if (buf == NULL) { ! *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'"); return NULL; } ! if (lnump != NULL) ! *lnump = ECMD_LAST; ! if (buf->b_fname == NULL) { ! result = (char_u *)""; ! valid = 0; /* Must have ":p:h" to be valid */ } - else - result = buf->b_fname; break; #ifdef FEAT_SEARCHPATH --- 9508,9557 ---- break; } s = src + 1; + if (*s == '<') /* "#<99" uses v:oldfiles */ + ++s; i = (int)getdigits(&s); *usedlen = (int)(s - src); /* length of what we expand */ ! if (src[1] == '<') { ! if (*usedlen < 2) ! { ! /* Should we give an error message for #b_fname == NULL) ! { ! result = (char_u *)""; ! valid = 0; /* Must have ":p:h" to be valid */ ! } ! else ! result = buf->b_fname; } break; #ifdef FEAT_SEARCHPATH *************** *** 10689,10695 **** p_viminfo = (char_u *)"'100"; if (eap->cmdidx == CMD_rviminfo) { ! if (read_viminfo(eap->arg, TRUE, TRUE, eap->forceit) == FAIL) EMSG(_("E195: Cannot open viminfo file for reading")); } else --- 10726,10733 ---- p_viminfo = (char_u *)"'100"; if (eap->cmdidx == CMD_rviminfo) { ! if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS ! | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL) EMSG(_("E195: Cannot open viminfo file for reading")); } else *** ../vim-7.2.018/src/fileio.c Wed Aug 6 18:43:07 2008 --- src/fileio.c Tue Sep 16 21:24:26 2008 *************** *** 2711,2717 **** { if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 && curbuf->b_ffname != NULL) ! read_viminfo(NULL, FALSE, TRUE, FALSE); /* Always set b_marks_read; needed when 'viminfo' is changed to include * the ' parameter after opening a buffer. */ --- 2711,2717 ---- { if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 && curbuf->b_ffname != NULL) ! read_viminfo(NULL, VIF_WANT_MARKS); /* Always set b_marks_read; needed when 'viminfo' is changed to include * the ' parameter after opening a buffer. */ *** ../vim-7.2.018/src/main.c Thu Jul 24 19:34:23 2008 --- src/main.c Sun Sep 14 13:26:10 2008 *************** *** 645,655 **** #ifdef FEAT_VIMINFO /* ! * Read in registers, history etc, but not marks, from the viminfo file */ if (*p_viminfo != NUL) { ! read_viminfo(NULL, TRUE, FALSE, FALSE); TIME_MSG("reading viminfo"); } #endif --- 645,656 ---- #ifdef FEAT_VIMINFO /* ! * Read in registers, history etc, but not marks, from the viminfo file. ! * This is where v:oldfiles gets filled. */ if (*p_viminfo != NUL) { ! read_viminfo(NULL, VIF_WANT_INFO | VIF_GET_OLDFILES); TIME_MSG("reading viminfo"); } #endif *** ../vim-7.2.018/src/mark.c Sat Aug 9 19:37:29 2008 --- src/mark.c Sun Sep 14 13:46:19 2008 *************** *** 1627,1641 **** /* * 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 */ void ! copy_viminfo_marks(virp, fp_out, count, eof) vir_T *virp; FILE *fp_out; int count; int eof; { char_u *line = virp->vir_line; buf_T *buf; --- 1627,1643 ---- /* * Handle marks in the viminfo file: ! * 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, flags) vir_T *virp; FILE *fp_out; int count; int eof; + int flags; { char_u *line = virp->vir_line; buf_T *buf; *************** *** 1647,1656 **** --- 1649,1671 ---- 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,1686 **** --- 1696,1706 ---- 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,1694 **** load_marks = copy_marks_out = FALSE; if (fp_out == NULL) { ! if (curbuf->b_ffname != NULL) { if (*name_buf == NUL) /* only need to do this once */ home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE); --- 1708,1714 ---- load_marks = copy_marks_out = FALSE; if (fp_out == 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); *** ../vim-7.2.018/src/proto/eval.pro Sun Jan 6 20:06:30 2008 --- src/proto/eval.pro Sat Sep 13 19:14:37 2008 *************** *** 17,23 **** int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip)); char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip)); int skip_expr __ARGS((char_u **pp)); ! char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int dolist)); char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox)); int eval_to_number __ARGS((char_u *expr)); list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); --- 17,23 ---- int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip)); char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip)); int skip_expr __ARGS((char_u **pp)); ! char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int convert)); char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox)); int eval_to_number __ARGS((char_u *expr)); list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); *************** *** 46,52 **** --- 46,54 ---- void list_unref __ARGS((list_T *l)); void list_free __ARGS((list_T *l, int recurse)); dictitem_T *dict_lookup __ARGS((hashitem_T *hi)); + char_u *list_find_str __ARGS((list_T *l, long idx)); int list_append_dict __ARGS((list_T *list, dict_T *dict)); + int list_append_string __ARGS((list_T *l, char_u *str, int len)); int garbage_collect __ARGS((void)); dict_T *dict_alloc __ARGS((void)); int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str)); *************** *** 60,65 **** --- 62,69 ---- char_u *get_vim_var_str __ARGS((int idx)); void set_vcount __ARGS((long count, long count1)); void set_vim_var_string __ARGS((int idx, char_u *val, int len)); + void set_vim_var_list __ARGS((int idx, list_T *val)); + list_T *get_vim_var_list __ARGS((int idx)); void set_reg_var __ARGS((int c)); char_u *v_exception __ARGS((char_u *oldval)); char_u *v_throwpoint __ARGS((char_u *oldval)); *************** *** 94,99 **** --- 98,104 ---- void write_viminfo_varlist __ARGS((FILE *fp)); int store_session_globals __ARGS((FILE *fd)); void last_set_msg __ARGS((scid_T scriptID)); + void ex_oldfiles __ARGS((exarg_T *eap)); int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen)); char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags)); /* vim: set ft=c : */ *** ../vim-7.2.018/src/proto/ex_cmds.pro Sat May 5 20:13:58 2007 --- src/proto/ex_cmds.pro Sat Sep 13 17:27:21 2008 *************** *** 11,17 **** char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp)); void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname)); int viminfo_error __ARGS((char *errnum, char *message, char_u *line)); ! int read_viminfo __ARGS((char_u *file, int want_info, int want_marks, int forceit)); void write_viminfo __ARGS((char_u *file, int forceit)); int viminfo_readline __ARGS((vir_T *virp)); char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert)); --- 11,17 ---- char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp)); void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname)); int viminfo_error __ARGS((char *errnum, char *message, char_u *line)); ! int read_viminfo __ARGS((char_u *file, int flags)); void write_viminfo __ARGS((char_u *file, int forceit)); int viminfo_readline __ARGS((vir_T *virp)); char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert)); *** ../vim-7.2.018/src/proto/mark.pro Sat May 5 19:29:37 2007 --- src/proto/mark.pro Sat Sep 13 18:06:20 2008 *************** *** 26,30 **** void write_viminfo_filemarks __ARGS((FILE *fp)); int removable __ARGS((char_u *name)); int write_viminfo_marks __ARGS((FILE *fp_out)); ! void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof)); /* vim: set ft=c : */ --- 26,30 ---- void write_viminfo_filemarks __ARGS((FILE *fp)); int removable __ARGS((char_u *name)); int write_viminfo_marks __ARGS((FILE *fp_out)); ! void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags)); /* vim: set ft=c : */ *** ../vim-7.2.018/src/option.c Thu Jul 24 18:45:15 2008 --- src/option.c Sat Sep 13 18:29:41 2008 *************** *** 2593,2605 **** #ifdef FEAT_VIMINFO (char_u *)&p_viminfo, PV_NONE, #if defined(MSDOS) || defined(MSWIN) || defined(OS2) ! {(char_u *)"", (char_u *)"'20,<50,s10,h,rA:,rB:"} #else # ifdef AMIGA {(char_u *)"", ! (char_u *)"'20,<50,s10,h,rdf0:,rdf1:,rdf2:"} # else ! {(char_u *)"", (char_u *)"'20,<50,s10,h"} # endif #endif #else --- 2593,2605 ---- #ifdef FEAT_VIMINFO (char_u *)&p_viminfo, PV_NONE, #if defined(MSDOS) || defined(MSWIN) || defined(OS2) ! {(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"} #else # ifdef AMIGA {(char_u *)"", ! (char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"} # else ! {(char_u *)"", (char_u *)"'100,<50,s10,h"} # endif #endif #else *** ../vim-7.2.018/src/vim.h Sat Aug 9 19:37:40 2008 --- src/vim.h Sat Sep 13 17:41:24 2008 *************** *** 1728,1734 **** #define VV_MOUSE_COL 51 #define VV_OP 52 #define VV_SEARCHFORWARD 53 ! #define VV_LEN 54 /* number of v: vars */ #ifdef FEAT_CLIPBOARD --- 1728,1735 ---- #define VV_MOUSE_COL 51 #define VV_OP 52 #define VV_SEARCHFORWARD 53 ! #define VV_OLDFILES 54 ! #define VV_LEN 55 /* number of v: vars */ #ifdef FEAT_CLIPBOARD *************** *** 2054,2057 **** --- 2055,2064 ---- #define DOSO_VIMRC 1 /* loading vimrc file */ #define DOSO_GVIMRC 2 /* loading gvimrc file */ + /* flags for read_viminfo() and children */ + #define VIF_WANT_INFO 1 /* load non-mark info */ + #define VIF_WANT_MARKS 2 /* load file marks */ + #define VIF_FORCEIT 4 /* overwrite info already read */ + #define VIF_GET_OLDFILES 8 /* load v:oldfiles */ + #endif /* VIM__H */