comparison src/evalfunc.c @ 17857:4935244c1128 v8.1.1925

patch 8.1.1925: more functions can be used as methods Commit: https://github.com/vim/vim/commit/4c313b13fb7bfa694ec6d2a13175e8650c007b2a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 24 22:58:31 2019 +0200 patch 8.1.1925: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make various functions usable as a method.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Aug 2019 23:00:04 +0200
parents 285f7a700185
children 521ce0d887e5
comparison
equal deleted inserted replaced
17856:786c5c8ba565 17857:4935244c1128
559 {"funcref", 1, 3, FEARG_1, f_funcref}, 559 {"funcref", 1, 3, FEARG_1, f_funcref},
560 {"function", 1, 3, FEARG_1, f_function}, 560 {"function", 1, 3, FEARG_1, f_function},
561 {"garbagecollect", 0, 1, 0, f_garbagecollect}, 561 {"garbagecollect", 0, 1, 0, f_garbagecollect},
562 {"get", 2, 3, FEARG_1, f_get}, 562 {"get", 2, 3, FEARG_1, f_get},
563 {"getbufinfo", 0, 1, 0, f_getbufinfo}, 563 {"getbufinfo", 0, 1, 0, f_getbufinfo},
564 {"getbufline", 2, 3, 0, f_getbufline}, 564 {"getbufline", 2, 3, FEARG_1, f_getbufline},
565 {"getbufvar", 2, 3, 0, f_getbufvar}, 565 {"getbufvar", 2, 3, FEARG_1, f_getbufvar},
566 {"getchangelist", 1, 1, 0, f_getchangelist}, 566 {"getchangelist", 0, 1, FEARG_1, f_getchangelist},
567 {"getchar", 0, 1, 0, f_getchar}, 567 {"getchar", 0, 1, 0, f_getchar},
568 {"getcharmod", 0, 0, 0, f_getcharmod}, 568 {"getcharmod", 0, 0, 0, f_getcharmod},
569 {"getcharsearch", 0, 0, 0, f_getcharsearch}, 569 {"getcharsearch", 0, 0, 0, f_getcharsearch},
570 {"getcmdline", 0, 0, 0, f_getcmdline}, 570 {"getcmdline", 0, 0, 0, f_getcmdline},
571 {"getcmdpos", 0, 0, 0, f_getcmdpos}, 571 {"getcmdpos", 0, 0, 0, f_getcmdpos},
572 {"getcmdtype", 0, 0, 0, f_getcmdtype}, 572 {"getcmdtype", 0, 0, 0, f_getcmdtype},
573 {"getcmdwintype", 0, 0, 0, f_getcmdwintype}, 573 {"getcmdwintype", 0, 0, 0, f_getcmdwintype},
574 {"getcompletion", 2, 3, 0, f_getcompletion}, 574 {"getcompletion", 2, 3, FEARG_1, f_getcompletion},
575 {"getcurpos", 0, 0, 0, f_getcurpos}, 575 {"getcurpos", 0, 0, 0, f_getcurpos},
576 {"getcwd", 0, 2, 0, f_getcwd}, 576 {"getcwd", 0, 2, FEARG_1, f_getcwd},
577 {"getenv", 1, 1, 0, f_getenv}, 577 {"getenv", 1, 1, FEARG_1, f_getenv},
578 {"getfontname", 0, 1, 0, f_getfontname}, 578 {"getfontname", 0, 1, 0, f_getfontname},
579 {"getfperm", 1, 1, 0, f_getfperm}, 579 {"getfperm", 1, 1, FEARG_1, f_getfperm},
580 {"getfsize", 1, 1, 0, f_getfsize}, 580 {"getfsize", 1, 1, FEARG_1, f_getfsize},
581 {"getftime", 1, 1, 0, f_getftime}, 581 {"getftime", 1, 1, FEARG_1, f_getftime},
582 {"getftype", 1, 1, 0, f_getftype}, 582 {"getftype", 1, 1, FEARG_1, f_getftype},
583 {"getjumplist", 0, 2, 0, f_getjumplist}, 583 {"getjumplist", 0, 2, FEARG_1, f_getjumplist},
584 {"getline", 1, 2, 0, f_getline}, 584 {"getline", 1, 2, FEARG_1, f_getline},
585 {"getloclist", 1, 2, 0, f_getloclist}, 585 {"getloclist", 1, 2, 0, f_getloclist},
586 {"getmatches", 0, 1, 0, f_getmatches}, 586 {"getmatches", 0, 1, 0, f_getmatches},
587 {"getpid", 0, 0, 0, f_getpid}, 587 {"getpid", 0, 0, 0, f_getpid},
588 {"getpos", 1, 1, 0, f_getpos}, 588 {"getpos", 1, 1, FEARG_1, f_getpos},
589 {"getqflist", 0, 1, 0, f_getqflist}, 589 {"getqflist", 0, 1, 0, f_getqflist},
590 {"getreg", 0, 3, 0, f_getreg}, 590 {"getreg", 0, 3, FEARG_1, f_getreg},
591 {"getregtype", 0, 1, 0, f_getregtype}, 591 {"getregtype", 0, 1, FEARG_1, f_getregtype},
592 {"gettabinfo", 0, 1, 0, f_gettabinfo}, 592 {"gettabinfo", 0, 1, FEARG_1, f_gettabinfo},
593 {"gettabvar", 2, 3, 0, f_gettabvar}, 593 {"gettabvar", 2, 3, FEARG_1, f_gettabvar},
594 {"gettabwinvar", 3, 4, 0, f_gettabwinvar}, 594 {"gettabwinvar", 3, 4, FEARG_1, f_gettabwinvar},
595 {"gettagstack", 0, 1, 0, f_gettagstack}, 595 {"gettagstack", 0, 1, 0, f_gettagstack},
596 {"getwininfo", 0, 1, 0, f_getwininfo}, 596 {"getwininfo", 0, 1, 0, f_getwininfo},
597 {"getwinpos", 0, 1, 0, f_getwinpos}, 597 {"getwinpos", 0, 1, 0, f_getwinpos},
598 {"getwinposx", 0, 0, 0, f_getwinposx}, 598 {"getwinposx", 0, 0, 0, f_getwinposx},
599 {"getwinposy", 0, 0, 0, f_getwinposy}, 599 {"getwinposy", 0, 0, 0, f_getwinposy},
791 {"setbufline", 3, 3, 0, f_setbufline}, 791 {"setbufline", 3, 3, 0, f_setbufline},
792 {"setbufvar", 3, 3, 0, f_setbufvar}, 792 {"setbufvar", 3, 3, 0, f_setbufvar},
793 {"setcharsearch", 1, 1, 0, f_setcharsearch}, 793 {"setcharsearch", 1, 1, 0, f_setcharsearch},
794 {"setcmdpos", 1, 1, 0, f_setcmdpos}, 794 {"setcmdpos", 1, 1, 0, f_setcmdpos},
795 {"setenv", 2, 2, 0, f_setenv}, 795 {"setenv", 2, 2, 0, f_setenv},
796 {"setfperm", 2, 2, 0, f_setfperm}, 796 {"setfperm", 2, 2, FEARG_1, f_setfperm},
797 {"setline", 2, 2, 0, f_setline}, 797 {"setline", 2, 2, 0, f_setline},
798 {"setloclist", 2, 4, 0, f_setloclist}, 798 {"setloclist", 2, 4, 0, f_setloclist},
799 {"setmatches", 1, 2, 0, f_setmatches}, 799 {"setmatches", 1, 2, 0, f_setmatches},
800 {"setpos", 2, 2, 0, f_setpos}, 800 {"setpos", 2, 2, 0, f_setpos},
801 {"setqflist", 1, 3, 0, f_setqflist}, 801 {"setqflist", 1, 3, 0, f_setqflist},
4475 4475
4476 if (rettv_list_alloc(rettv) != OK) 4476 if (rettv_list_alloc(rettv) != OK)
4477 return; 4477 return;
4478 4478
4479 #ifdef FEAT_JUMPLIST 4479 #ifdef FEAT_JUMPLIST
4480 (void)tv_get_number(&argvars[0]); /* issue errmsg if type error */ 4480 if (argvars[0].v_type == VAR_UNKNOWN)
4481 ++emsg_off; 4481 buf = curbuf;
4482 buf = tv_get_buf(&argvars[0], FALSE); 4482 else
4483 --emsg_off; 4483 {
4484 (void)tv_get_number(&argvars[0]); // issue errmsg if type error
4485 ++emsg_off;
4486 buf = tv_get_buf(&argvars[0], FALSE);
4487 --emsg_off;
4488 }
4484 if (buf == NULL) 4489 if (buf == NULL)
4485 return; 4490 return;
4486 4491
4487 l = list_alloc(); 4492 l = list_alloc();
4488 if (l == NULL) 4493 if (l == NULL)