4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Can't set the '" mark. Can't know if setpos() was successful.
12 Solution: Allow setting the '" mark with setpos(). Have setpos() return a
13 value indicating success/failure.
14 Files: runtime/doc/eval.txt, src/eval.c, src/mark.c
17 *** ../vim-7.1.247/runtime/doc/eval.txt Sat Jan 12 16:45:25 2008
18 --- runtime/doc/eval.txt Wed Feb 13 11:49:16 2008
21 ! *eval.txt* For Vim version 7.1. Last change: 2008 Jan 11
24 VIM REFERENCE MANUAL by Bram Moolenaar
26 ! *eval.txt* For Vim version 7.1. Last change: 2008 Feb 13
29 VIM REFERENCE MANUAL by Bram Moolenaar
33 character. E.g., a position within a <Tab> or after the last
36 + Returns 0 when the position could be set, -1 otherwise.
37 + An error message is given if {expr} is invalid.
41 This does not restore the preferred column for moving
42 *** ../vim-7.1.247/src/eval.c Tue Jan 22 11:58:41 2008
43 --- src/eval.c Wed Feb 13 11:54:09 2008
49 name = get_tv_string_chk(argvars);
52 if (list2fpos(&argvars[1], &pos, &fnum) == OK)
55 ! if (name[0] == '.') /* cursor */
57 if (fnum == curbuf->b_fnum)
59 curwin->w_cursor = pos;
65 ! else if (name[0] == '\'') /* mark */
66 ! (void)setmark_pos(name[1], &pos, fnum);
74 + rettv->vval.v_number = -1;
75 name = get_tv_string_chk(argvars);
78 if (list2fpos(&argvars[1], &pos, &fnum) == OK)
81 ! if (name[0] == '.' && name[1] == NUL)
84 if (fnum == curbuf->b_fnum)
86 curwin->w_cursor = pos;
88 + rettv->vval.v_number = 0;
93 ! else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
96 ! if (setmark_pos(name[1], &pos, fnum) == OK)
97 ! rettv->vval.v_number = 0;
102 *** ../vim-7.1.247/src/mark.c Thu Jan 3 20:21:34 2008
103 --- src/mark.c Wed Feb 13 11:42:30 2008
112 + curbuf->b_last_cursor = *pos;
116 /* Allow setting '[ and '] for an autocommand that simulates reading a
119 *** ../vim-7.1.247/src/version.c Wed Feb 13 10:57:11 2008
120 --- src/version.c Wed Feb 13 12:39:23 2008
124 { /* Add new patch number below this line */
130 "Making it up? Why should I want to make anything up? Life's bad enough
131 as it is without wanting to invent any more of it."
132 -- Marvin, the Paranoid Android in Douglas Adams'
133 "The Hitchhiker's Guide to the Galaxy"
135 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
136 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
137 \\\ download, build and distribute -- http://www.A-A-P.org ///
138 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///