0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

updated for version 7.1-248

This commit is contained in:
Bram Moolenaar
2008-02-13 11:42:46 +00:00
parent e21877ae75
commit 0825043045
4 changed files with 22 additions and 4 deletions

View 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 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. E.g., a position within a <Tab> or after the last
character. character.
Returns 0 when the position could be set, -1 otherwise.
An error message is given if {expr} is invalid.
Also see |getpos()| Also see |getpos()|
This does not restore the preferred column for moving This does not restore the preferred column for moving

View File

@@ -14776,24 +14776,31 @@ f_setpos(argvars, rettv)
int fnum; int fnum;
char_u *name; char_u *name;
rettv->vval.v_number = -1;
name = get_tv_string_chk(argvars); name = get_tv_string_chk(argvars);
if (name != NULL) if (name != NULL)
{ {
if (list2fpos(&argvars[1], &pos, &fnum) == OK) if (list2fpos(&argvars[1], &pos, &fnum) == OK)
{ {
--pos.col; --pos.col;
if (name[0] == '.') /* cursor */ if (name[0] == '.' && name[1] == NUL)
{ {
/* set cursor */
if (fnum == curbuf->b_fnum) if (fnum == curbuf->b_fnum)
{ {
curwin->w_cursor = pos; curwin->w_cursor = pos;
check_cursor(); check_cursor();
rettv->vval.v_number = 0;
} }
else else
EMSG(_(e_invarg)); EMSG(_(e_invarg));
} }
else if (name[0] == '\'') /* mark */ else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
(void)setmark_pos(name[1], &pos, fnum); {
/* set mark */
if (setmark_pos(name[1], &pos, fnum) == OK)
rettv->vval.v_number = 0;
}
else else
EMSG(_(e_invarg)); EMSG(_(e_invarg));
} }

View File

@@ -79,6 +79,12 @@ setmark_pos(c, pos, fnum)
return OK; return OK;
} }
if (c == '"')
{
curbuf->b_last_cursor = *pos;
return OK;
}
/* Allow setting '[ and '] for an autocommand that simulates reading a /* Allow setting '[ and '] for an autocommand that simulates reading a
* file. */ * file. */
if (c == '[') if (c == '[')

View File

@@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
248,
/**/ /**/
247, 247,
/**/ /**/