4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Information in the viminfo file about previously edited files is
12 not available to the user. There is no way to get a complete list
13 of files edited in previous Vim sessions.
14 Solution: Add v:oldfiles and fill it with the list of old file names when
15 first reading the viminfo file. Add the ":oldfiles" command,
16 ":browse oldfiles" and the "#<123" special file name. Increase
17 the default value for 'viminfo' from '20 to '100.
18 Files: runtime/doc/cmdline.txt, runtime/doc/eval.txt,
19 runtime/doc/starting.txt, runtime/doc/usr_21.txt, src/eval.c,
20 src/ex_cmds.c, src/ex_cmds.h, src/ex_docmd.c, src/feature.h,
21 src/fileio.c, src/main.c, src/mark.c, src/misc1.c,
22 src/proto/eval.pro, src/proto/ex_cmds.pro, src/proto/mark.pro,
23 src/option.c, src/structs.h, src/vim.h
26 *** ../vim-7.2.030/runtime/doc/cmdline.txt Sat Aug 9 19:36:46 2008
27 --- runtime/doc/cmdline.txt Thu Sep 18 22:55:27 2008
30 ! *cmdline.txt* For Vim version 7.2. Last change: 2008 Jul 29
33 VIM REFERENCE MANUAL by Bram Moolenaar
35 ! *cmdline.txt* For Vim version 7.2. Last change: 2008 Sep 18
38 VIM REFERENCE MANUAL by Bram Moolenaar
42 (doesn't work at the expression prompt; some
43 things such as changing the buffer or current
44 window are not allowed to avoid side effects)
45 + When the result is a |List| the items are used
46 + as lines. They can have line breaks inside
48 + When the result is a Float it's automatically
49 + converted to a String.
50 See |registers| about registers. {not in Vi}
51 Implementation detail: When using the |expression| register
52 and invoking setcmdpos(), this sets the position before
55 In Ex commands, at places where a file name can be used, the following
56 characters have a special meaning. These can also be used in the expression
57 function expand() |expand()|.
58 ! % is replaced with the current file name *:_%*
59 ! # is replaced with the alternate file name *:_#*
60 #n (where n is a number) is replaced with the file name of
61 ! buffer n. "#0" is the same as "#"
62 ! ## is replaced with all names in the argument list *:_##*
63 concatenated, separated by spaces. Each space in a name
64 is preceded with a backslash.
65 ! Note that these give the file name as it was typed. If an absolute path is
66 ! needed (when using the file name from a different directory), you need to add
67 ! ":p". See |filename-modifiers|.
68 Note that backslashes are inserted before spaces, so that the command will
69 correctly interpret the file name. But this doesn't happen for shell
70 ! commands. For those you probably have to use quotes: >
75 In Ex commands, at places where a file name can be used, the following
76 characters have a special meaning. These can also be used in the expression
77 function expand() |expand()|.
78 ! % Is replaced with the current file name. *:_%* *c_%*
79 ! # Is replaced with the alternate file name. *:_#* *c_#*
80 #n (where n is a number) is replaced with the file name of
81 ! buffer n. "#0" is the same as "#".
82 ! ## Is replaced with all names in the argument list *:_##* *c_##*
83 concatenated, separated by spaces. Each space in a name
84 is preceded with a backslash.
85 ! #<n (where n is a number > 0) is replaced with old *:_#<* *c_#<*
86 ! file name n. See |:oldfiles| or |v:oldfiles| to get the
88 ! {only when compiled with the +eval and +viminfo features}
90 ! Note that these, except "#<n", give the file name as it was typed. If an
91 ! absolute path is needed (when using the file name from a different directory),
92 ! you need to add ":p". See |filename-modifiers|.
94 ! The "#<n" item returns an absolute path, but it will start with "~/" for files
95 ! below your home directory.
97 Note that backslashes are inserted before spaces, so that the command will
98 correctly interpret the file name. But this doesn't happen for shell
99 ! commands. For those you probably have to use quotes (this fails for files
100 ! that contain a quote and wildcards): >
104 *** ../vim-7.2.030/runtime/doc/eval.txt Sat Aug 9 19:36:47 2008
105 --- runtime/doc/eval.txt Sun Nov 2 14:25:38 2008
108 ! *eval.txt* For Vim version 7.2. Last change: 2008 Aug 09
111 VIM REFERENCE MANUAL by Bram Moolenaar
113 ! *eval.txt* For Vim version 7.2. Last change: 2008 Nov 02
116 VIM REFERENCE MANUAL by Bram Moolenaar
120 This is the screen column number, like with |virtcol()|. The
121 value is zero when there was no mouse button click.
123 + *v:oldfiles* *oldfiles-variable*
124 + v:oldfiles List of file names that is loaded from the |viminfo| file on
125 + startup. These are the files that Vim remembers marks for.
126 + The length of the List is limited by the ' argument of the
127 + 'viminfo' option (default is 100).
128 + Also see |:oldfiles| and |c_#<|.
129 + The List can be modified, but this has no effect on what is
130 + stored in the |viminfo| file later. If you use values other
131 + than String this will cause trouble.
132 + {only when compiled with the +viminfo feature}
134 *v:operator* *operator-variable*
135 v:operator The last operator given in Normal mode. This is a single
136 character except for commands starting with <g> or <z>,
137 *** ../vim-7.2.030/runtime/doc/starting.txt Sat Aug 9 19:36:52 2008
138 --- runtime/doc/starting.txt Sun Nov 9 12:12:19 2008
141 ! *starting.txt* For Vim version 7.2. Last change: 2008 Jun 21
144 VIM REFERENCE MANUAL by Bram Moolenaar
146 ! *starting.txt* For Vim version 7.2. Last change: 2008 Nov 09
149 VIM REFERENCE MANUAL by Bram Moolenaar
153 When Vim is started and the 'viminfo' option is non-empty, the contents of
154 the viminfo file are read and the info can be used in the appropriate places.
155 ! The marks are not read in at startup (but file marks are). See
156 ! |initialization| for how to set the 'viminfo' option upon startup.
159 When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
162 When Vim is started and the 'viminfo' option is non-empty, the contents of
163 the viminfo file are read and the info can be used in the appropriate places.
164 ! The |v:oldfiles| variable is filled. The marks are not read in at startup
165 ! (but file marks are). See |initialization| for how to set the 'viminfo'
166 ! option upon startup.
169 When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
173 that start with any string given with the "r" flag in 'viminfo'. This can be
174 used to avoid saving marks for files on removable media (for MS-DOS you would
175 use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:").
176 + The |v:oldfiles| variable is filled with the file names that the viminfo file
180 Uppercase marks ('A to 'Z) are stored when writing the viminfo file. The
183 *:rv* *:rviminfo* *E195*
184 :rv[iminfo][!] [file] Read from viminfo file [file] (default: see above).
185 If [!] is given, then any information that is
186 ! already set (registers, marks, etc.) will be
187 ! overwritten. {not in Vi}
189 *:wv* *:wviminfo* *E137* *E138* *E574*
190 :wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
192 *:rv* *:rviminfo* *E195*
193 :rv[iminfo][!] [file] Read from viminfo file [file] (default: see above).
194 If [!] is given, then any information that is
195 ! already set (registers, marks, |v:oldfiles|, etc.)
196 ! will be overwritten {not in Vi}
198 *:wv* *:wviminfo* *E137* *E138* *E574*
199 :wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
207 + :ol[dfiles] List the files that have marks stored in the viminfo
208 + file. This list is read on startup and only changes
209 + afterwards with ":rviminfo!". Also see |v:oldfiles|.
210 + The number can be used with |c_#<|.
211 + {not in Vi, only when compiled with the +eval feature}
213 + :bro[wse] ol[dfiles][!]
214 + List file names as with |:oldfiles|, and then prompt
215 + for a number. When the number is valid that file from
216 + the list is edited.
217 + If you get the |press-enter| prompt you can press "q"
218 + and still get the prompt to enter a file number.
219 + Use ! to abondon a modified buffer. |abandon|
220 + {not when compiled with tiny or small features}
222 vim:tw=78:ts=8:ft=help:norl:
223 *** ../vim-7.2.030/runtime/doc/usr_21.txt Sat Aug 9 19:36:53 2008
224 --- runtime/doc/usr_21.txt Sun Nov 9 12:14:10 2008
227 ! *usr_21.txt* For Vim version 7.2. Last change: 2007 May 01
229 VIM USER MANUAL - by Bram Moolenaar
232 ! *usr_21.txt* For Vim version 7.2. Last change: 2008 Nov 09
234 VIM USER MANUAL - by Bram Moolenaar
238 to be lost. Each item can be remembered only once.
241 ! GETTING BACK TO WHERE YOU WERE
243 You are halfway editing a file and it's time to leave for holidays. You exit
244 Vim and go enjoy yourselves, forgetting all about your work. After a couple
246 to be lost. Each item can be remembered only once.
249 ! GETTING BACK TO WHERE YOU STOPPED VIM
251 You are halfway editing a file and it's time to leave for holidays. You exit
252 Vim and go enjoy yourselves, forgetting all about your work. After a couple
256 The |:marks| command is useful to find out where '0 to '9 will take you.
259 + GETTING BACK TO SOME FILE
261 + If you want to go back to a file that you edited recently, but not when
262 + exiting Vim, there is a slightly more complicated way. You can see a list of
263 + files by typing the command: >
267 + 2: ~/text/resume.txt ~
270 + Now you would like to edit the second file, which is in the list preceded by
275 + Instead of ":e" you can use any command that has a file name argument, the
276 + "#<2" item works in the same place as "%" (current file name) and "#"
277 + (alternate file name). So you can also split the window to edit the third
282 + That #<123 thing is a bit complicated when you just want to edit a file.
283 + Fortunately there is a simpler way: >
287 + 2: ~/text/resume.txt ~
291 + You get the same list of files as with |:oldfiles|. If you want to edit
292 + "resume.txt" first press "q" to stop the listing. You will get a prompt:
294 + Type number and <Enter> (empty cancels): ~
296 + Type "2" and press <Enter> to edit the second file.
298 + More info at |:oldfiles|, |v:oldfiles| and |c_#<|.
301 MOVE INFO FROM ONE VIM TO ANOTHER
303 You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
304 *** ../vim-7.2.030/src/eval.c Thu Nov 6 11:04:50 2008
305 --- src/eval.c Sun Nov 9 11:59:39 2008
309 {VV_NAME("mouse_col", VAR_NUMBER), 0},
310 {VV_NAME("operator", VAR_STRING), VV_RO},
311 {VV_NAME("searchforward", VAR_NUMBER), 0},
312 + {VV_NAME("oldfiles", VAR_LIST), 0},
319 #define vv_nr vv_di.di_tv.vval.v_number
320 #define vv_float vv_di.di_tv.vval.v_float
321 #define vv_str vv_di.di_tv.vval.v_string
322 + #define vv_list vv_di.di_tv.vval.v_list
323 #define vv_tv vv_di.di_tv
328 static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
329 static void list_append __ARGS((list_T *l, listitem_T *item));
330 static int list_append_tv __ARGS((list_T *l, typval_T *tv));
331 - static int list_append_string __ARGS((list_T *l, char_u *str, int len));
332 static int list_append_number __ARGS((list_T *l, varnumber_T n));
333 static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
334 static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
339 if (p->vv_di.di_tv.v_type == VAR_STRING)
341 ! vim_free(p->vv_di.di_tv.vval.v_string);
342 ! p->vv_di.di_tv.vval.v_string = NULL;
345 hash_clear(&vimvarht);
348 if (p->vv_di.di_tv.v_type == VAR_STRING)
350 ! vim_free(p->vv_string);
351 ! p->vv_string = NULL;
353 ! else if (p->vv_di.di_tv.v_type == VAR_LIST)
355 ! list_unref(p->vv_list);
359 hash_clear(&vimvarht);
366 + * Get list item "l[idx - 1]" as a string. Returns NULL for failure.
369 + list_find_str(l, idx)
375 + li = list_find(l, idx - 1);
378 + EMSGN(_(e_listidx), idx);
381 + return get_tv_string(&li->li_tv);
385 * Locate "item" list "l" and return its index.
386 * Returns -1 when "item" is not in the list.
390 * When "len" >= 0 use "str[len]".
391 * Returns FAIL when out of memory.
394 list_append_string(l, str, len)
398 * When "len" >= 0 use "str[len]".
399 * Returns FAIL when out of memory.
402 list_append_string(l, str, len)
408 set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID);
412 + set_ref_in_ht(&vimvarht, copyID);
415 * 2. Go through the list of dicts and free items without the copyID.
421 dd = tv->vval.v_dict;
422 ! if (dd->dv_copyID != copyID)
424 /* Didn't see this dict yet. */
425 dd->dv_copyID = copyID;
429 dd = tv->vval.v_dict;
430 ! if (dd != NULL && dd->dv_copyID != copyID)
432 /* Didn't see this dict yet. */
433 dd->dv_copyID = copyID;
438 ll = tv->vval.v_list;
439 ! if (ll->lv_copyID != copyID)
441 /* Didn't see this list yet. */
442 ll->lv_copyID = copyID;
446 ll = tv->vval.v_list;
447 ! if (ll != NULL && ll->lv_copyID != copyID)
449 /* Didn't see this list yet. */
450 ll->lv_copyID = copyID;
457 + * Get List v: variable value. Caller must take care of reference count when
461 + get_vim_var_list(idx)
464 + return vimvars[idx].vv_list;
468 * Set v:count, v:count1 and v:prevcount.
477 + * Set List v: variable to "val".
480 + set_vim_var_list(idx, val)
484 + list_unref(vimvars[idx].vv_list);
485 + vimvars[idx].vv_list = val;
487 + ++val->lv_refcount;
491 * Set v:register if needed.
501 + * List v:oldfiles in a nice way.
508 + list_T *l = vimvars[VV_OLDFILES].vv_list;
513 + msg((char_u *)_("No old files"));
518 + for (li = l->lv_first; li != NULL && !got_int; li = li->li_next)
520 + msg_outnum((long)++nr);
522 + msg_outtrans(get_tv_string(&li->li_tv));
524 + out_flush(); /* output one line at a time */
527 + /* Assume "got_int" was set to truncate the listing. */
530 + #ifdef FEAT_BROWSE_CMD
534 + nr = prompt_for_number(FALSE);
538 + char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES),
543 + p = expand_env_save(p);
545 + eap->cmdidx = CMD_edit;
546 + cmdmod.browse = FALSE;
547 + do_exedit(eap, NULL);
556 #endif /* FEAT_EVAL */
559 *** ../vim-7.2.030/src/ex_cmds.c Sun Sep 14 21:40:26 2008
560 --- src/ex_cmds.c Sun Sep 14 13:45:03 2008
563 static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
565 static char_u *viminfo_filename __ARGS((char_u *));
566 ! static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int want_info, int want_marks, int force_read));
567 static int viminfo_encoding __ARGS((vir_T *virp));
568 static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
571 static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
573 static char_u *viminfo_filename __ARGS((char_u *));
574 ! static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags));
575 static int viminfo_encoding __ARGS((vir_T *virp));
576 static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
582 * read_viminfo() -- Read the viminfo file. Registers etc. which are already
583 ! * set are not over-written unless force is TRUE. -- webb
586 ! read_viminfo(file, want_info, want_marks, forceit)
597 * read_viminfo() -- Read the viminfo file. Registers etc. which are already
598 ! * set are not over-written unless "flags" includes VIF_FORCEIT. -- webb
601 ! read_viminfo(file, flags)
602 ! char_u *file; /* file name or NULL to use default name */
603 ! int flags; /* VIF_WANT_INFO et al. */
612 ! fname = viminfo_filename(file); /* may set to default if NULL */
615 fp = mch_fopen((char *)fname, READBIN);
620 ! fname = viminfo_filename(file); /* get file name in allocated buffer */
623 fp = mch_fopen((char *)fname, READBIN);
627 smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
629 ! want_info ? _(" info") : "",
630 ! want_marks ? _(" marks") : "",
631 fp == NULL ? _(" FAILED") : "");
636 smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
638 ! (flags & VIF_WANT_INFO) ? _(" info") : "",
639 ! (flags & VIF_WANT_MARKS) ? _(" marks") : "",
640 ! (flags & VIF_GET_OLDFILES) ? _(" oldfiles") : "",
641 fp == NULL ? _(" FAILED") : "");
649 ! do_viminfo(fp, NULL, want_info, want_marks, forceit);
660 ! do_viminfo(fp, NULL, flags);
671 ! do_viminfo(fp_in, fp_out, !forceit, !forceit, FALSE);
673 fclose(fp_out); /* errors are ignored !? */
679 ! do_viminfo(fp_in, fp_out, forceit ? 0 : (VIF_WANT_INFO | VIF_WANT_MARKS));
681 fclose(fp_out); /* errors are ignored !? */
685 * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
688 ! do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
698 * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
701 ! do_viminfo(fp_in, fp_out, flags)
714 ! eof = read_viminfo_up_to_marks(&vir, force_read, fp_out != NULL);
716 /* Skip info, find start of marks */
717 while (!(eof = viminfo_readline(&vir))
722 ! if (flags & VIF_WANT_INFO)
723 ! eof = read_viminfo_up_to_marks(&vir,
724 ! flags & VIF_FORCEIT, fp_out != NULL);
726 /* Skip info, find start of marks */
727 while (!(eof = viminfo_readline(&vir))
730 write_viminfo_bufferlist(fp_out);
731 count = write_viminfo_marks(fp_out);
733 ! if (fp_in != NULL && want_marks)
734 ! copy_viminfo_marks(&vir, fp_out, count, eof);
736 vim_free(vir.vir_line);
739 write_viminfo_bufferlist(fp_out);
740 count = write_viminfo_marks(fp_out);
743 ! && (flags & (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT)))
744 ! copy_viminfo_marks(&vir, fp_out, count, eof, flags);
746 vim_free(vir.vir_line);
748 *** ../vim-7.2.030/src/ex_cmds.h Thu Nov 6 20:47:00 2008
749 --- src/ex_cmds.h Thu Sep 18 22:18:14 2008
753 EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
754 EX(CMD_open, "open", ex_open,
756 + EX(CMD_oldfiles, "oldfiles", ex_oldfiles,
757 + BANG|TRLBAR|SBOXOK|CMDWIN),
758 EX(CMD_omap, "omap", ex_map,
759 EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
760 EX(CMD_omapclear, "omapclear", ex_mapclear,
761 *** ../vim-7.2.030/src/ex_docmd.c Thu Nov 6 17:16:06 2008
762 --- src/ex_docmd.c Mon Nov 3 21:21:17 2008
766 # define ex_function ex_ni
767 # define ex_delfunction ex_ni
768 # define ex_return ex_ni
769 + # define ex_oldfiles ex_ni
771 static char_u *arg_all __ARGS((void));
776 if (checkforcmd(&ea.cmd, "browse", 3))
779 cmdmod.browse = TRUE;
784 if (checkforcmd(&ea.cmd, "browse", 3))
786 ! #ifdef FEAT_BROWSE_CMD
787 cmdmod.browse = TRUE;
795 i = (int)getdigits(&s);
796 *usedlen = (int)(s - src); /* length of what we expand */
798 ! buf = buflist_findnr(i);
801 ! *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
805 ! *lnump = ECMD_LAST;
806 ! if (buf->b_fname == NULL)
808 ! result = (char_u *)"";
809 ! valid = 0; /* Must have ":p:h" to be valid */
812 - result = buf->b_fname;
815 #ifdef FEAT_SEARCHPATH
820 + if (*s == '<') /* "#<99" uses v:oldfiles */
822 i = (int)getdigits(&s);
823 *usedlen = (int)(s - src); /* length of what we expand */
829 ! /* Should we give an error message for #<text? */
834 ! result = list_find_str(get_vim_var_list(VV_OLDFILES),
836 ! if (result == NULL)
838 ! *errormsg = (char_u *)"";
842 ! *errormsg = (char_u *)_("E809: #< is not available without the +eval feature");
848 ! buf = buflist_findnr(i);
851 ! *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
855 ! *lnump = ECMD_LAST;
856 ! if (buf->b_fname == NULL)
858 ! result = (char_u *)"";
859 ! valid = 0; /* Must have ":p:h" to be valid */
862 ! result = buf->b_fname;
866 #ifdef FEAT_SEARCHPATH
869 p_viminfo = (char_u *)"'100";
870 if (eap->cmdidx == CMD_rviminfo)
872 ! if (read_viminfo(eap->arg, TRUE, TRUE, eap->forceit) == FAIL)
873 EMSG(_("E195: Cannot open viminfo file for reading"));
877 p_viminfo = (char_u *)"'100";
878 if (eap->cmdidx == CMD_rviminfo)
880 ! if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
881 ! | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
882 EMSG(_("E195: Cannot open viminfo file for reading"));
885 *** ../vim-7.2.030/src/feature.h Wed Aug 6 18:45:07 2008
886 --- src/feature.h Fri Sep 19 19:14:22 2008
891 * +browse ":browse" command.
893 ! #if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
894 ! # define FEAT_BROWSE
901 * +browse ":browse" command.
902 + * or just the ":browse" command modifier
904 ! #if defined(FEAT_NORMAL)
905 ! # define FEAT_BROWSE_CMD
906 ! # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
907 ! # define FEAT_BROWSE
912 *** ../vim-7.2.030/src/fileio.c Thu Sep 18 21:29:07 2008
913 --- src/fileio.c Mon Nov 3 21:21:47 2008
917 if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
918 && curbuf->b_ffname != NULL)
919 ! read_viminfo(NULL, FALSE, TRUE, FALSE);
921 /* Always set b_marks_read; needed when 'viminfo' is changed to include
922 * the ' parameter after opening a buffer. */
925 if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
926 && curbuf->b_ffname != NULL)
927 ! read_viminfo(NULL, VIF_WANT_MARKS);
929 /* Always set b_marks_read; needed when 'viminfo' is changed to include
930 * the ' parameter after opening a buffer. */
933 set_context_in_autocmd(xp, arg, doautocmd)
936 ! int doautocmd; /* TRUE for :doautocmd, FALSE for :autocmd */
941 set_context_in_autocmd(xp, arg, doautocmd)
944 ! int doautocmd; /* TRUE for :doauto*, FALSE for :autocmd */
948 *** ../vim-7.2.030/src/main.c Thu Sep 18 20:55:19 2008
949 --- src/main.c Sun Sep 14 13:26:10 2008
955 ! * Read in registers, history etc, but not marks, from the viminfo file
957 if (*p_viminfo != NUL)
959 ! read_viminfo(NULL, TRUE, FALSE, FALSE);
960 TIME_MSG("reading viminfo");
967 ! * Read in registers, history etc, but not marks, from the viminfo file.
968 ! * This is where v:oldfiles gets filled.
970 if (*p_viminfo != NUL)
972 ! read_viminfo(NULL, VIF_WANT_INFO | VIF_GET_OLDFILES);
973 TIME_MSG("reading viminfo");
976 *** ../vim-7.2.030/src/mark.c Sat Aug 9 19:37:29 2008
977 --- src/mark.c Sun Sep 14 13:46:19 2008
982 * Handle marks in the viminfo file:
983 ! * fp_out == NULL read marks for current buffer only
984 ! * fp_out != NULL copy marks for buffers not in buffer list
987 ! copy_viminfo_marks(virp, fp_out, count, eof)
993 char_u *line = virp->vir_line;
998 * Handle marks in the viminfo file:
999 ! * fp_out != NULL: copy marks for buffers not in buffer list
1000 ! * fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf only
1001 ! * fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
1004 ! copy_viminfo_marks(virp, fp_out, count, eof, flags)
1011 char_u *line = virp->vir_line;
1020 + list_T *list = NULL;
1023 if ((name_buf = alloc(LSIZE)) == NULL)
1028 + if (fp_out == NULL && (flags & (VIF_GET_OLDFILES | VIF_FORCEIT)))
1030 + list = list_alloc();
1032 + set_vim_var_list(VV_OLDFILES, list);
1036 num_marked_files = get_viminfo_parameter('\'');
1037 while (!eof && (count < num_marked_files || fp_out == NULL))
1047 + list_append_string(list, str, -1);
1051 * If fp_out == NULL, load marks for current buffer.
1052 * If fp_out != NULL, copy marks for buffers not in buflist.
1055 load_marks = copy_marks_out = FALSE;
1058 ! if (curbuf->b_ffname != NULL)
1060 if (*name_buf == NUL) /* only need to do this once */
1061 home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
1063 load_marks = copy_marks_out = FALSE;
1066 ! if ((flags & VIF_WANT_MARKS) && curbuf->b_ffname != NULL)
1068 if (*name_buf == NUL) /* only need to do this once */
1069 home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
1070 *** ../vim-7.2.030/src/misc1.c Wed Jun 25 00:24:52 2008
1071 --- src/misc1.c Sun Nov 9 11:47:00 2008
1075 /* When using ":silent" assume that <CR> was entered. */
1076 if (mouse_used != NULL)
1077 ! MSG_PUTS(_("Type number or click with mouse (<Enter> cancels): "));
1079 ! MSG_PUTS(_("Choice number (<Enter> cancels): "));
1081 /* Set the state such that text can be selected/copied/pasted and we still
1082 * get mouse events. */
1085 /* When using ":silent" assume that <CR> was entered. */
1086 if (mouse_used != NULL)
1087 ! MSG_PUTS(_("Type number and <Enter> or click with mouse (empty cancels): "));
1089 ! MSG_PUTS(_("Type number and <Enter> (empty cancels): "));
1091 /* Set the state such that text can be selected/copied/pasted and we still
1092 * get mouse events. */
1093 *** ../vim-7.2.030/src/proto/eval.pro Sun Jan 6 20:06:30 2008
1094 --- src/proto/eval.pro Sun Nov 9 12:05:56 2008
1097 int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
1098 char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
1099 int skip_expr __ARGS((char_u **pp));
1100 ! char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int dolist));
1101 char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox));
1102 int eval_to_number __ARGS((char_u *expr));
1103 list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
1105 int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
1106 char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
1107 int skip_expr __ARGS((char_u **pp));
1108 ! char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int convert));
1109 char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox));
1110 int eval_to_number __ARGS((char_u *expr));
1111 list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
1115 void list_unref __ARGS((list_T *l));
1116 void list_free __ARGS((list_T *l, int recurse));
1117 dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
1118 + char_u *list_find_str __ARGS((list_T *l, long idx));
1119 int list_append_dict __ARGS((list_T *list, dict_T *dict));
1120 + int list_append_string __ARGS((list_T *l, char_u *str, int len));
1121 int garbage_collect __ARGS((void));
1122 dict_T *dict_alloc __ARGS((void));
1123 int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
1127 void set_vim_var_nr __ARGS((int idx, long val));
1128 long get_vim_var_nr __ARGS((int idx));
1129 char_u *get_vim_var_str __ARGS((int idx));
1130 + list_T *get_vim_var_list __ARGS((int idx));
1131 void set_vcount __ARGS((long count, long count1));
1132 void set_vim_var_string __ARGS((int idx, char_u *val, int len));
1133 + void set_vim_var_list __ARGS((int idx, list_T *val));
1134 void set_reg_var __ARGS((int c));
1135 char_u *v_exception __ARGS((char_u *oldval));
1136 char_u *v_throwpoint __ARGS((char_u *oldval));
1140 void write_viminfo_varlist __ARGS((FILE *fp));
1141 int store_session_globals __ARGS((FILE *fd));
1142 void last_set_msg __ARGS((scid_T scriptID));
1143 + void ex_oldfiles __ARGS((exarg_T *eap));
1144 int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen));
1145 char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags));
1146 /* vim: set ft=c : */
1147 *** ../vim-7.2.030/src/proto/ex_cmds.pro Sat May 5 20:13:58 2007
1148 --- src/proto/ex_cmds.pro Sat Sep 13 17:27:21 2008
1151 char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
1152 void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
1153 int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
1154 ! int read_viminfo __ARGS((char_u *file, int want_info, int want_marks, int forceit));
1155 void write_viminfo __ARGS((char_u *file, int forceit));
1156 int viminfo_readline __ARGS((vir_T *virp));
1157 char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
1159 char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
1160 void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
1161 int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
1162 ! int read_viminfo __ARGS((char_u *file, int flags));
1163 void write_viminfo __ARGS((char_u *file, int forceit));
1164 int viminfo_readline __ARGS((vir_T *virp));
1165 char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
1166 *** ../vim-7.2.030/src/proto/mark.pro Sat May 5 19:29:37 2007
1167 --- src/proto/mark.pro Sat Sep 13 18:06:20 2008
1170 void write_viminfo_filemarks __ARGS((FILE *fp));
1171 int removable __ARGS((char_u *name));
1172 int write_viminfo_marks __ARGS((FILE *fp_out));
1173 ! void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof));
1174 /* vim: set ft=c : */
1176 void write_viminfo_filemarks __ARGS((FILE *fp));
1177 int removable __ARGS((char_u *name));
1178 int write_viminfo_marks __ARGS((FILE *fp_out));
1179 ! void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags));
1180 /* vim: set ft=c : */
1181 *** ../vim-7.2.030/src/option.c Thu Oct 2 22:48:01 2008
1182 --- src/option.c Fri Sep 26 22:20:20 2008
1186 (char_u *)&p_viminfo, PV_NONE,
1187 #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
1188 ! {(char_u *)"", (char_u *)"'20,<50,s10,h,rA:,rB:"}
1192 ! (char_u *)"'20,<50,s10,h,rdf0:,rdf1:,rdf2:"}
1194 ! {(char_u *)"", (char_u *)"'20,<50,s10,h"}
1200 (char_u *)&p_viminfo, PV_NONE,
1201 #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
1202 ! {(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"}
1206 ! (char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"}
1208 ! {(char_u *)"", (char_u *)"'100,<50,s10,h"}
1212 *** ../vim-7.2.030/src/structs.h Thu Jul 31 22:04:27 2008
1213 --- src/structs.h Fri Sep 19 19:15:18 2008
1218 int hide; /* TRUE when ":hide" was used */
1219 ! # ifdef FEAT_BROWSE
1220 int browse; /* TRUE to invoke file dialog */
1222 # ifdef FEAT_WINDOWS
1226 int hide; /* TRUE when ":hide" was used */
1227 ! # ifdef FEAT_BROWSE_CMD
1228 int browse; /* TRUE to invoke file dialog */
1230 # ifdef FEAT_WINDOWS
1231 *** ../vim-7.2.030/src/vim.h Sat Aug 9 19:37:40 2008
1232 --- src/vim.h Sat Sep 13 17:41:24 2008
1235 #define VV_MOUSE_COL 51
1237 #define VV_SEARCHFORWARD 53
1238 ! #define VV_LEN 54 /* number of v: vars */
1240 #ifdef FEAT_CLIPBOARD
1243 #define VV_MOUSE_COL 51
1245 #define VV_SEARCHFORWARD 53
1246 ! #define VV_OLDFILES 54
1247 ! #define VV_LEN 55 /* number of v: vars */
1249 #ifdef FEAT_CLIPBOARD
1254 #define DOSO_VIMRC 1 /* loading vimrc file */
1255 #define DOSO_GVIMRC 2 /* loading gvimrc file */
1257 + /* flags for read_viminfo() and children */
1258 + #define VIF_WANT_INFO 1 /* load non-mark info */
1259 + #define VIF_WANT_MARKS 2 /* load file marks */
1260 + #define VIF_FORCEIT 4 /* overwrite info already read */
1261 + #define VIF_GET_OLDFILES 8 /* load v:oldfiles */
1264 *** ../vim-7.2.030/src/version.c Thu Nov 6 20:47:00 2008
1265 --- src/version.c Sun Nov 9 13:39:19 2008
1269 { /* Add new patch number below this line */
1275 hundred-and-one symptoms of being an internet addict:
1276 217. Your sex life has drastically improved...so what if it's only cyber-sex!
1278 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
1279 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1280 \\\ download, build and distribute -- http://www.A-A-P.org ///
1281 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///