diff src/evalfunc.c @ 25431:634aed775408 v8.2.3252

patch 8.2.3252: duplicated code for adding buffer lines Commit: https://github.com/vim/vim/commit/4a15504e911bc90a29d862862f0b7a46d8acd12a Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Fri Jul 30 21:32:45 2021 +0200 patch 8.2.3252: duplicated code for adding buffer lines Problem: Duplicated code for adding buffer lines. Solution: Move code to a common function. Also move map functions to map.c. (Yegappan Lakshmanan, closes #8665)
author Bram Moolenaar <Bram@vim.org>
date Fri, 30 Jul 2021 21:45:02 +0200
parents e8e2c4d33b9b
children 5dce28f92d04
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -98,8 +98,6 @@ static void f_line2byte(typval_T *argvar
 #ifdef FEAT_LUA
 static void f_luaeval(typval_T *argvars, typval_T *rettv);
 #endif
-static void f_maparg(typval_T *argvars, typval_T *rettv);
-static void f_mapcheck(typval_T *argvars, typval_T *rettv);
 static void f_match(typval_T *argvars, typval_T *rettv);
 static void f_matchend(typval_T *argvars, typval_T *rettv);
 static void f_matchlist(typval_T *argvars, typval_T *rettv);
@@ -6734,40 +6732,6 @@ f_luaeval(typval_T *argvars, typval_T *r
 }
 #endif
 
-/*
- * "maparg()" function
- */
-    static void
-f_maparg(typval_T *argvars, typval_T *rettv)
-{
-    if (in_vim9script()
-	    && (check_for_string_arg(argvars, 0) == FAIL
-		|| check_for_opt_string_arg(argvars, 1) == FAIL
-		|| (argvars[1].v_type != VAR_UNKNOWN
-		    && (check_for_opt_bool_arg(argvars, 2) == FAIL
-			|| (argvars[2].v_type != VAR_UNKNOWN
-			    && check_for_opt_bool_arg(argvars, 3) == FAIL)))))
-		return;
-
-    get_maparg(argvars, rettv, TRUE);
-}
-
-/*
- * "mapcheck()" function
- */
-    static void
-f_mapcheck(typval_T *argvars, typval_T *rettv)
-{
-    if (in_vim9script()
-	    && (check_for_string_arg(argvars, 0) == FAIL
-		|| check_for_opt_string_arg(argvars, 1) == FAIL
-		|| (argvars[1].v_type != VAR_UNKNOWN
-		    && check_for_opt_bool_arg(argvars, 2) == FAIL)))
-	return;
-
-    get_maparg(argvars, rettv, FALSE);
-}
-
 typedef enum
 {
     MATCH_END,	    // matchend()