diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-02-13 11:42:46 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-02-13 11:42:46 +0000 |
commit | 0825043045f69784ed5a4db952988ca5ae7f6d48 (patch) | |
tree | c1e5e8df6bcdced1032437c7614203e17ee314e2 /src/eval.c | |
parent | e21877ae759827ce9b4422c55dce33237dd175a4 (diff) |
updated for version 7.1-248v7.1.248
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index 7093051b76..0f2461e112 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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)); } |