comparison src/eval.c @ 8011:26f555e9aab1 v7.4.1300

commit https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 10 22:23:06 2016 +0100 patch 7.4.1300 Problem: Cannot test CursorMovedI because there is typeahead. Solution: Add disable_char_avail_for_testing().
author Christian Brabandt <cb@256bit.org>
date Wed, 10 Feb 2016 22:30:04 +0100
parents e5dbeb923ce6
children b421c7f2f172
comparison
equal deleted inserted replaced
8010:cbfb5ac5f9c5 8011:26f555e9aab1
530 static void f_deepcopy(typval_T *argvars, typval_T *rettv); 530 static void f_deepcopy(typval_T *argvars, typval_T *rettv);
531 static void f_delete(typval_T *argvars, typval_T *rettv); 531 static void f_delete(typval_T *argvars, typval_T *rettv);
532 static void f_did_filetype(typval_T *argvars, typval_T *rettv); 532 static void f_did_filetype(typval_T *argvars, typval_T *rettv);
533 static void f_diff_filler(typval_T *argvars, typval_T *rettv); 533 static void f_diff_filler(typval_T *argvars, typval_T *rettv);
534 static void f_diff_hlID(typval_T *argvars, typval_T *rettv); 534 static void f_diff_hlID(typval_T *argvars, typval_T *rettv);
535 static void f_disable_char_avail_for_testing(typval_T *argvars, typval_T *rettv);
535 static void f_empty(typval_T *argvars, typval_T *rettv); 536 static void f_empty(typval_T *argvars, typval_T *rettv);
536 static void f_escape(typval_T *argvars, typval_T *rettv); 537 static void f_escape(typval_T *argvars, typval_T *rettv);
537 static void f_eval(typval_T *argvars, typval_T *rettv); 538 static void f_eval(typval_T *argvars, typval_T *rettv);
538 static void f_eventhandler(typval_T *argvars, typval_T *rettv); 539 static void f_eventhandler(typval_T *argvars, typval_T *rettv);
539 static void f_executable(typval_T *argvars, typval_T *rettv); 540 static void f_executable(typval_T *argvars, typval_T *rettv);
8109 {"deepcopy", 1, 2, f_deepcopy}, 8110 {"deepcopy", 1, 2, f_deepcopy},
8110 {"delete", 1, 2, f_delete}, 8111 {"delete", 1, 2, f_delete},
8111 {"did_filetype", 0, 0, f_did_filetype}, 8112 {"did_filetype", 0, 0, f_did_filetype},
8112 {"diff_filler", 1, 1, f_diff_filler}, 8113 {"diff_filler", 1, 1, f_diff_filler},
8113 {"diff_hlID", 2, 2, f_diff_hlID}, 8114 {"diff_hlID", 2, 2, f_diff_hlID},
8115 {"disable_char_avail_for_testing", 1, 1, f_disable_char_avail_for_testing},
8114 {"empty", 1, 1, f_empty}, 8116 {"empty", 1, 1, f_empty},
8115 {"escape", 2, 2, f_escape}, 8117 {"escape", 2, 2, f_escape},
8116 {"eval", 1, 1, f_eval}, 8118 {"eval", 1, 1, f_eval},
8117 {"eventhandler", 0, 0, f_eventhandler}, 8119 {"eventhandler", 0, 0, f_eventhandler},
8118 {"executable", 1, 1, f_executable}, 8120 {"executable", 1, 1, f_executable},
10604 rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID; 10606 rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID;
10605 #endif 10607 #endif
10606 } 10608 }
10607 10609
10608 /* 10610 /*
10611 * "disable_char_avail_for_testing({expr})" function
10612 */
10613 static void
10614 f_disable_char_avail_for_testing(typval_T *argvars, typval_T *rettv UNUSED)
10615 {
10616 disable_char_avail_for_testing = get_tv_number(&argvars[0]);
10617 }
10618
10619 /*
10609 * "empty({expr})" function 10620 * "empty({expr})" function
10610 */ 10621 */
10611 static void 10622 static void
10612 f_empty(typval_T *argvars, typval_T *rettv) 10623 f_empty(typval_T *argvars, typval_T *rettv)
10613 { 10624 {
12447 #ifdef FEAT_VIRTUALEDIT 12458 #ifdef FEAT_VIRTUALEDIT
12448 (fp != NULL) ? (varnumber_T)fp->coladd : 12459 (fp != NULL) ? (varnumber_T)fp->coladd :
12449 #endif 12460 #endif
12450 (varnumber_T)0); 12461 (varnumber_T)0);
12451 if (getcurpos) 12462 if (getcurpos)
12463 {
12464 update_curswant();
12452 list_append_number(l, curwin->w_curswant == MAXCOL ? 12465 list_append_number(l, curwin->w_curswant == MAXCOL ?
12453 (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1); 12466 (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1);
12467 }
12454 } 12468 }
12455 else 12469 else
12456 rettv->vval.v_number = FALSE; 12470 rettv->vval.v_number = FALSE;
12457 } 12471 }
12458 12472