Mercurial > vim
comparison src/eval.c @ 5940:f6f754304324 v7.4.311
updated for version 7.4.311
Problem: Can't use winrestview to only restore part of the view.
Solution: Handle missing items in the dict. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 28 May 2014 16:47:16 +0200 |
parents | ccac0aa34eea |
children | 66eead134d68 |
comparison
equal
deleted
inserted
replaced
5939:f972a1841779 | 5940:f6f754304324 |
---|---|
19229 if (argvars[0].v_type != VAR_DICT | 19229 if (argvars[0].v_type != VAR_DICT |
19230 || (dict = argvars[0].vval.v_dict) == NULL) | 19230 || (dict = argvars[0].vval.v_dict) == NULL) |
19231 EMSG(_(e_invarg)); | 19231 EMSG(_(e_invarg)); |
19232 else | 19232 else |
19233 { | 19233 { |
19234 curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); | 19234 if (dict_find(dict, (char_u *)"lnum", -1) != NULL) |
19235 curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); | 19235 curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); |
19236 if (dict_find(dict, (char_u *)"col", -1) != NULL) | |
19237 curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); | |
19236 #ifdef FEAT_VIRTUALEDIT | 19238 #ifdef FEAT_VIRTUALEDIT |
19237 curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); | 19239 if (dict_find(dict, (char_u *)"coladd", -1) != NULL) |
19238 #endif | 19240 curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); |
19239 curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); | 19241 #endif |
19240 curwin->w_set_curswant = FALSE; | 19242 if (dict_find(dict, (char_u *)"curswant", -1) != NULL) |
19241 | 19243 { |
19242 set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); | 19244 curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); |
19245 curwin->w_set_curswant = FALSE; | |
19246 } | |
19247 | |
19248 if (dict_find(dict, (char_u *)"topline", -1) != NULL) | |
19249 set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); | |
19243 #ifdef FEAT_DIFF | 19250 #ifdef FEAT_DIFF |
19244 curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); | 19251 if (dict_find(dict, (char_u *)"topfill", -1) != NULL) |
19245 #endif | 19252 curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); |
19246 curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); | 19253 #endif |
19247 curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); | 19254 if (dict_find(dict, (char_u *)"leftcol", -1) != NULL) |
19255 curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); | |
19256 if (dict_find(dict, (char_u *)"skipcol", -1) != NULL) | |
19257 curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); | |
19248 | 19258 |
19249 check_cursor(); | 19259 check_cursor(); |
19250 win_new_height(curwin, curwin->w_height); | 19260 win_new_height(curwin, curwin->w_height); |
19251 # ifdef FEAT_VERTSPLIT | 19261 # ifdef FEAT_VERTSPLIT |
19252 win_new_width(curwin, W_WIDTH(curwin)); | 19262 win_new_width(curwin, W_WIDTH(curwin)); |