vim-patch:7.4.311

Problem:    Can't use winrestview to only restore part of the view.
Solution:   Handle missing items in the dict. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=v7-4-311
This commit is contained in:
David Rodriguez 2014-06-30 17:58:56 -04:00 committed by Florian Walch
parent c3de63bfbc
commit c824e7b2d2
2 changed files with 26 additions and 11 deletions

View File

@ -15247,16 +15247,31 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv)
|| (dict = argvars[0].vval.v_dict) == NULL)
EMSG(_(e_invarg));
else {
curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum");
curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col");
curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd");
curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant");
curwin->w_set_curswant = FALSE;
set_topline(curwin, get_dict_number(dict, (char_u *)"topline"));
curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill");
curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol");
curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol");
if (dict_find(dict, (char_u *)"lnum", -1) != NULL) {
curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum");
}
if (dict_find(dict, (char_u *)"col", -1) != NULL) {
curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col");
}
if (dict_find(dict, (char_u *)"coladd", -1) != NULL) {
curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd");
}
if (dict_find(dict, (char_u *)"curswant", -1) != NULL) {
curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant");
curwin->w_set_curswant = FALSE;
}
if (dict_find(dict, (char_u *)"topline", -1) != NULL) {
set_topline(curwin, get_dict_number(dict, (char_u *)"topline"));
}
if (dict_find(dict, (char_u *)"topfill", -1) != NULL) {
curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill");
}
if (dict_find(dict, (char_u *)"leftcol", -1) != NULL) {
curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol");
}
if (dict_find(dict, (char_u *)"skipcol", -1) != NULL) {
curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol");
}
check_cursor();
win_new_height(curwin, curwin->w_height);

View File

@ -426,7 +426,7 @@ static int included_patches[] = {
314,
313,
312,
//311,
311,
310,
309,
308,