]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-248 v7.1.248
authorBram Moolenaar <Bram@vim.org>
Wed, 13 Feb 2008 11:42:46 +0000 (11:42 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 13 Feb 2008 11:42:46 +0000 (11:42 +0000)
runtime/doc/eval.txt
src/eval.c
src/mark.c
src/version.c

index 5a665c36e98f5dfaa89b2f39d71a5d8c64d7cd92..7acf740eda8b403fdccd6e912dcb1dd05f1c5110 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.1.  Last change: 2008 Jan 11
+*eval.txt*      For Vim version 7.1.  Last change: 2008 Feb 13
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -4523,6 +4523,9 @@ setpos({expr}, {list})
                character.  E.g., a position within a <Tab> or after the last
                character.
 
+               Returns 0 when the position could be set, -1 otherwise.
+               An error message is given if {expr} is invalid.
+
                Also see |getpos()|
 
                This does not restore the preferred column for moving
index 7093051b760f15d8ace0561fc518e3992884bdde..0f2461e1126d99f3e48c3351c384732658a22f71 100644 (file)
@@ -14776,24 +14776,31 @@ f_setpos(argvars, rettv)
     int                fnum;
     char_u     *name;
 
+    rettv->vval.v_number = -1;
     name = get_tv_string_chk(argvars);
     if (name != NULL)
     {
        if (list2fpos(&argvars[1], &pos, &fnum) == OK)
        {
            --pos.col;
-           if (name[0] == '.')         /* cursor */
+           if (name[0] == '.' && name[1] == NUL)
            {
+               /* set cursor */
                if (fnum == curbuf->b_fnum)
                {
                    curwin->w_cursor = pos;
                    check_cursor();
+                   rettv->vval.v_number = 0;
                }
                else
                    EMSG(_(e_invarg));
            }
-           else if (name[0] == '\'')   /* mark */
-               (void)setmark_pos(name[1], &pos, fnum);
+           else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
+           {
+               /* set mark */
+               if (setmark_pos(name[1], &pos, fnum) == OK)
+                   rettv->vval.v_number = 0;
+           }
            else
                EMSG(_(e_invarg));
        }
index 6dc593440c235278ba0b05a2896367330320dc8f..2accbba1fb4cf61885ccd8875d435e3325224734 100644 (file)
@@ -79,6 +79,12 @@ setmark_pos(c, pos, fnum)
        return OK;
     }
 
+    if (c == '"')
+    {
+       curbuf->b_last_cursor = *pos;
+       return OK;
+    }
+
     /* Allow setting '[ and '] for an autocommand that simulates reading a
      * file. */
     if (c == '[')
index 740c1358e511713af9bd78d15c68d6ab216d3a66..d6046666b25228b115f20a8e27d3827326b509ce 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    248,
 /**/
     247,
 /**/