local s = selection.grow(sel); */ local s = selection.grow(sel, "north"); */
| 628 | /* local s = selection.grow(sel); */ |
| 629 | /* local s = selection.grow(sel, "north"); */ |
| 630 | staticfn int |
| 631 | l_selection_grow(lua_State *L) |
| 632 | { |
| 633 | static const char *const growdirs[] = { |
| 634 | "all", "random", "north", "west", "east", "south", NULL |
| 635 | }; |
| 636 | static const int growdirs2i[] = { |
| 637 | W_ANY, W_RANDOM, W_NORTH, W_WEST, W_EAST, W_SOUTH, 0 |
| 638 | }; |
| 639 | struct selectionvar *sel; |
| 640 | int dir, argc = lua_gettop(L); |
| 641 | |
| 642 | (void) l_selection_check(L, 1); |
| 643 | dir = growdirs2i[luaL_checkoption(L, 2, "all", growdirs)]; |
| 644 | |
| 645 | if (argc == 2) |
| 646 | lua_pop(L, 1); /* get rid of growdir */ |
| 647 | |
| 648 | (void) l_selection_clone(L); |
| 649 | sel = l_selection_check(L, 2); |
| 650 | selection_do_grow(sel, dir); |
| 651 | return 1; |
| 652 | } |
| 653 | |
| 654 | |
| 655 | /* local s = selection.filter_mapchar(sel, mapchar, lit); */ |
nothing calls this directly
no test coverage detected