diff src/digraph.c @ 25378:890fd8211202 v8.2.3226

patch 8.2.3226: new digraph functions use old naming scheme Commit: https://github.com/vim/vim/commit/29b857150c111a455f1a38a8f748243524f692e1 Author: h-east <h.east.727@gmail.com> Date: Mon Jul 26 21:54:04 2021 +0200 patch 8.2.3226: new digraph functions use old naming scheme Problem: New digraph functions use old naming scheme. Solution: Use the digraph_ prefix. (Hirohito Higashi, closes https://github.com/vim/vim/issues/8580)
author Bram Moolenaar <Bram@vim.org>
date Mon, 26 Jul 2021 22:00:07 +0200
parents 078edc1821bf
children e8e2c4d33b9b
line wrap: on
line diff
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -1781,7 +1781,7 @@ do_digraph(int c)
     else if (p_dg)
     {
 	if (backspaced >= 0)
-	    c = getdigraph(backspaced, c, FALSE);
+	    c = digraph_get(backspaced, c, FALSE);
 	backspaced = -1;
 	if ((c == K_BS || c == Ctrl_H) && lastchar >= 0)
 	    backspaced = lastchar;
@@ -1887,7 +1887,7 @@ get_digraph(
 	--no_mapping;
 	--allow_keys;
 	if (cc != ESC)	    // ESC cancels CTRL-K
-	    return getdigraph(c, cc, TRUE);
+	    return digraph_get(c, cc, TRUE);
     }
     return NUL;
 }
@@ -1981,7 +1981,7 @@ getexactdigraph(int char1, int char2, in
  * Allow for both char1-char2 and char2-char1
  */
     int
-getdigraph(int char1, int char2, int meta_char)
+digraph_get(int char1, int char2, int meta_char)
 {
     int	    retval;
 
@@ -2143,7 +2143,7 @@ listdigraphs(int use_headers)
 }
 
     static void
-getdigraphlist_appendpair(digr_T *dp, list_T *l)
+digraph_getlist_appendpair(digr_T *dp, list_T *l)
 {
     char_u	buf[30];
     char_u	*p;
@@ -2194,7 +2194,7 @@ getdigraphlist_appendpair(digr_T *dp, li
 }
 
     void
-getdigraphlist_common(int list_all, typval_T *rettv)
+digraph_getlist_common(int list_all, typval_T *rettv)
 {
     int		i;
     digr_T	*dp;
@@ -2215,11 +2215,11 @@ getdigraphlist_common(int list_all, typv
 	    tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE);
 	    if (tmp.result != 0 && tmp.result != tmp.char2
 					  && (has_mbyte || tmp.result <= 255))
-		getdigraphlist_appendpair(&tmp, rettv->vval.v_list);
+		digraph_getlist_appendpair(&tmp, rettv->vval.v_list);
 #else
 	    if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result
 		    && (has_mbyte || dp->result <= 255))
-		getdigraphlist_appendpair(dp, rettv->vval.v_list);
+		digraph_getlist_appendpair(dp, rettv->vval.v_list);
 #endif
 	    ++dp;
 	}
@@ -2228,7 +2228,7 @@ getdigraphlist_common(int list_all, typv
     dp = (digr_T *)user_digraphs.ga_data;
     for (i = 0; i < user_digraphs.ga_len && !got_int; ++i)
     {
-	getdigraphlist_appendpair(dp, rettv->vval.v_list);
+	digraph_getlist_appendpair(dp, rettv->vval.v_list);
 	++dp;
     }
 }
@@ -2363,7 +2363,7 @@ get_digraph_chars(typval_T *arg, int *ch
 }
 
     static int
-setdigraph_common(typval_T *argchars, typval_T *argdigraph)
+digraph_set_common(typval_T *argchars, typval_T *argdigraph)
 {
     int		char1, char2;
     char_u	*digraph;
@@ -2394,10 +2394,10 @@ setdigraph_common(typval_T *argchars, ty
 
 #if defined(FEAT_EVAL) || defined(PROTO)
 /*
- * "getdigraph()" function
+ * "digraph_get()" function
  */
     void
-f_getdigraph(typval_T *argvars, typval_T *rettv)
+f_digraph_get(typval_T *argvars, typval_T *rettv)
 {
 # ifdef FEAT_DIGRAPHS
     int		code;
@@ -2415,7 +2415,7 @@ f_getdigraph(typval_T *argvars, typval_T
 	semsg(_(e_digraph_must_be_just_two_characters_str), digraphs);
 	return;
     }
-    code = getdigraph(digraphs[0], digraphs[1], FALSE);
+    code = digraph_get(digraphs[0], digraphs[1], FALSE);
 
     if (has_mbyte)
 	buf[(*mb_char2bytes)(code, buf)] = NUL;
@@ -2431,10 +2431,10 @@ f_getdigraph(typval_T *argvars, typval_T
 }
 
 /*
- * "getdigraphlist()" function
+ * "digraph_getlist()" function
  */
     void
-f_getdigraphlist(typval_T *argvars, typval_T *rettv)
+f_digraph_getlist(typval_T *argvars, typval_T *rettv)
 {
 # ifdef FEAT_DIGRAPHS
     int     flag_list_all;
@@ -2450,23 +2450,23 @@ f_getdigraphlist(typval_T *argvars, typv
 	flag_list_all = flag ? TRUE : FALSE;
     }
 
-    getdigraphlist_common(flag_list_all, rettv);
+    digraph_getlist_common(flag_list_all, rettv);
 # else
     emsg(_(e_no_digraphs_version));
 # endif
 }
 
 /*
- * "setdigraph()" function
+ * "digraph_set()" function
  */
     void
-f_setdigraph(typval_T *argvars, typval_T *rettv)
+f_digraph_set(typval_T *argvars, typval_T *rettv)
 {
 # ifdef FEAT_DIGRAPHS
     rettv->v_type = VAR_BOOL;
     rettv->vval.v_number = VVAL_FALSE;
 
-    if (!setdigraph_common(&argvars[0], &argvars[1]))
+    if (!digraph_set_common(&argvars[0], &argvars[1]))
 	return;
 
     rettv->vval.v_number = VVAL_TRUE;
@@ -2476,10 +2476,10 @@ f_setdigraph(typval_T *argvars, typval_T
 }
 
 /*
- * "setdigraphlist()" function
+ * "digraph_setlist()" function
  */
     void
-f_setdigraphlist(typval_T * argvars, typval_T *rettv)
+f_digraph_setlist(typval_T * argvars, typval_T *rettv)
 {
 # ifdef FEAT_DIGRAPHS
     list_T	*pl, *l;
@@ -2490,7 +2490,7 @@ f_setdigraphlist(typval_T * argvars, typ
 
     if (argvars[0].v_type != VAR_LIST)
     {
-	emsg(_(e_setdigraphlist_argument_must_be_list_of_lists_with_two_items));
+	emsg(_(e_digraph_setlist_argument_must_be_list_of_lists_with_two_items));
 	return;
     }
 
@@ -2506,18 +2506,18 @@ f_setdigraphlist(typval_T * argvars, typ
     {
 	if (pli->li_tv.v_type != VAR_LIST)
 	{
-	    emsg(_(e_setdigraphlist_argument_must_be_list_of_lists_with_two_items));
+	    emsg(_(e_digraph_setlist_argument_must_be_list_of_lists_with_two_items));
 	    return;
 	}
 
 	l = pli->li_tv.vval.v_list;
 	if (l == NULL || l->lv_len != 2)
 	{
-	    emsg(_(e_setdigraphlist_argument_must_be_list_of_lists_with_two_items));
+	    emsg(_(e_digraph_setlist_argument_must_be_list_of_lists_with_two_items));
 	    return;
 	}
 
-	if (!setdigraph_common(&l->lv_first->li_tv,
+	if (!digraph_set_common(&l->lv_first->li_tv,
 						 &l->lv_first->li_next->li_tv))
 	    return;
     }