@@ -1009,11 +1009,8 @@ f_win_splitmove(typval_T *argvars, typval_T *rettv)
10091009 dict_T * d ;
10101010 dictitem_T * di ;
10111011
1012- if (argvars [2 ].v_type != VAR_DICT || argvars [2 ].vval .v_dict == NULL )
1013- {
1014- emsg (_ (e_invalid_argument ));
1012+ if (check_for_nonnull_dict_arg (argvars , 2 ) == FAIL )
10151013 return ;
1016- }
10171014
10181015 d = argvars [2 ].vval .v_dict ;
10191016 if (dict_get_bool (d , "vertical" , FALSE))
@@ -1227,50 +1224,45 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
12271224{
12281225 dict_T * dict ;
12291226
1230- if (in_vim9script () && check_for_dict_arg (argvars , 0 ) == FAIL )
1227+ if (check_for_nonnull_dict_arg (argvars , 0 ) == FAIL )
12311228 return ;
12321229
1233- if (argvars [0 ].v_type != VAR_DICT
1234- || (dict = argvars [0 ].vval .v_dict ) == NULL )
1235- emsg (_ (e_invalid_argument ));
1236- else
1230+ dict = argvars [0 ].vval .v_dict ;
1231+ if (dict_has_key (dict , "lnum" ))
1232+ curwin -> w_cursor .lnum = (linenr_T )dict_get_number (dict , "lnum" );
1233+ if (dict_has_key (dict , "col" ))
1234+ curwin -> w_cursor .col = (colnr_T )dict_get_number (dict , "col" );
1235+ if (dict_has_key (dict , "coladd" ))
1236+ curwin -> w_cursor .coladd = (colnr_T )dict_get_number (dict , "coladd" );
1237+ if (dict_has_key (dict , "curswant" ))
12371238 {
1238- if (dict_has_key (dict , "lnum" ))
1239- curwin -> w_cursor .lnum = (linenr_T )dict_get_number (dict , "lnum" );
1240- if (dict_has_key (dict , "col" ))
1241- curwin -> w_cursor .col = (colnr_T )dict_get_number (dict , "col" );
1242- if (dict_has_key (dict , "coladd" ))
1243- curwin -> w_cursor .coladd = (colnr_T )dict_get_number (dict , "coladd" );
1244- if (dict_has_key (dict , "curswant" ))
1245- {
1246- curwin -> w_curswant = (colnr_T )dict_get_number (dict , "curswant" );
1247- curwin -> w_set_curswant = FALSE;
1248- }
1239+ curwin -> w_curswant = (colnr_T )dict_get_number (dict , "curswant" );
1240+ curwin -> w_set_curswant = FALSE;
1241+ }
12491242
1250- if (dict_has_key (dict , "topline" ))
1251- set_topline (curwin , (linenr_T )dict_get_number (dict , "topline" ));
1243+ if (dict_has_key (dict , "topline" ))
1244+ set_topline (curwin , (linenr_T )dict_get_number (dict , "topline" ));
12521245#ifdef FEAT_DIFF
1253- if (dict_has_key (dict , "topfill" ))
1254- curwin -> w_topfill = (int )dict_get_number (dict , "topfill" );
1246+ if (dict_has_key (dict , "topfill" ))
1247+ curwin -> w_topfill = (int )dict_get_number (dict , "topfill" );
12551248#endif
1256- if (dict_has_key (dict , "leftcol" ))
1257- curwin -> w_leftcol = (colnr_T )dict_get_number (dict , "leftcol" );
1258- if (dict_has_key (dict , "skipcol" ))
1259- curwin -> w_skipcol = (colnr_T )dict_get_number (dict , "skipcol" );
1260-
1261- check_cursor ();
1262- win_new_height (curwin , curwin -> w_height );
1263- win_new_width (curwin , curwin -> w_width );
1264- changed_window_setting ();
1265-
1266- if (curwin -> w_topline <= 0 )
1267- curwin -> w_topline = 1 ;
1268- if (curwin -> w_topline > curbuf -> b_ml .ml_line_count )
1269- curwin -> w_topline = curbuf -> b_ml .ml_line_count ;
1249+ if (dict_has_key (dict , "leftcol" ))
1250+ curwin -> w_leftcol = (colnr_T )dict_get_number (dict , "leftcol" );
1251+ if (dict_has_key (dict , "skipcol" ))
1252+ curwin -> w_skipcol = (colnr_T )dict_get_number (dict , "skipcol" );
1253+
1254+ check_cursor ();
1255+ win_new_height (curwin , curwin -> w_height );
1256+ win_new_width (curwin , curwin -> w_width );
1257+ changed_window_setting ();
1258+
1259+ if (curwin -> w_topline <= 0 )
1260+ curwin -> w_topline = 1 ;
1261+ if (curwin -> w_topline > curbuf -> b_ml .ml_line_count )
1262+ curwin -> w_topline = curbuf -> b_ml .ml_line_count ;
12701263#ifdef FEAT_DIFF
1271- check_topfill (curwin , TRUE);
1264+ check_topfill (curwin , TRUE);
12721265#endif
1273- }
12741266}
12751267
12761268/*
0 commit comments