mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
c3de63bfbc
commit
c824e7b2d2
@ -15247,16 +15247,31 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv)
|
|||||||
|| (dict = argvars[0].vval.v_dict) == NULL)
|
|| (dict = argvars[0].vval.v_dict) == NULL)
|
||||||
EMSG(_(e_invarg));
|
EMSG(_(e_invarg));
|
||||||
else {
|
else {
|
||||||
curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum");
|
if (dict_find(dict, (char_u *)"lnum", -1) != NULL) {
|
||||||
curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col");
|
curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum");
|
||||||
curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd");
|
}
|
||||||
curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant");
|
if (dict_find(dict, (char_u *)"col", -1) != NULL) {
|
||||||
curwin->w_set_curswant = FALSE;
|
curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col");
|
||||||
|
}
|
||||||
set_topline(curwin, get_dict_number(dict, (char_u *)"topline"));
|
if (dict_find(dict, (char_u *)"coladd", -1) != NULL) {
|
||||||
curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill");
|
curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd");
|
||||||
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 *)"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();
|
check_cursor();
|
||||||
win_new_height(curwin, curwin->w_height);
|
win_new_height(curwin, curwin->w_height);
|
||||||
|
@ -426,7 +426,7 @@ static int included_patches[] = {
|
|||||||
314,
|
314,
|
||||||
313,
|
313,
|
||||||
312,
|
312,
|
||||||
//311,
|
311,
|
||||||
310,
|
310,
|
||||||
309,
|
309,
|
||||||
308,
|
308,
|
||||||
|
Loading…
Reference in New Issue
Block a user