patch 9.1.0629: Rename of pum hl_group is incomplete

Problem:  Rename of pum hl_group is incomplete in source.
Solution: Also rename the test function.  Rename to user_hlattr in code
          to avoid confusion with pum_extra.  Add test with matched text
          highlighting (zeertzjq).

closes: #15348

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index a33d6be..c1ed03b 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -359,7 +359,7 @@
 	compl_match_array[i].pum_info = NULL;
 	compl_match_array[i].pum_extra = NULL;
 	compl_match_array[i].pum_kind = NULL;
-	compl_match_array[i].pum_extrahlattr = -1;
+	compl_match_array[i].pum_user_hlattr = -1;
     }
 
     // Compute the popup menu starting column
diff --git a/src/insexpand.c b/src/insexpand.c
index 02d29704..7a5298f 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -114,7 +114,7 @@
     int		cp_flags;	// CP_ values
     int		cp_number;	// sequence number
     int		cp_score;	// fuzzy match score
-    int		cp_extrahlattr;	// extra highlight group attr
+    int		cp_user_hlattr;	// highlight attribute to combine with
 };
 
 // values for cp_flags
@@ -206,7 +206,7 @@
 
 static int	  *compl_fuzzy_scores;
 
-static int ins_compl_add(char_u *str, int len, char_u *fname, char_u **cptext, typval_T *user_data, int cdir, int flags, int adup, int extrahl);
+static int ins_compl_add(char_u *str, int len, char_u *fname, char_u **cptext, typval_T *user_data, int cdir, int flags, int adup, int user_hlattr);
 static void ins_compl_longest_match(compl_T *match);
 static void ins_compl_del_pum(void);
 static void ins_compl_files(int count, char_u **files, int thesaurus, int flags, regmatch_T *regmatch, char_u *buf, int *dir);
@@ -780,7 +780,7 @@
     int		cdir,
     int		flags_arg,
     int		adup,		    // accept duplicate match
-    int		extra_hlattr)
+    int		user_hlattr)
 {
     compl_T	*match;
     int		dir = (cdir == 0 ? compl_direction : cdir);
@@ -844,7 +844,7 @@
     else
 	match->cp_fname = NULL;
     match->cp_flags = flags;
-    match->cp_extrahlattr = extra_hlattr;
+    match->cp_user_hlattr = user_hlattr;
 
     if (cptext != NULL)
     {
@@ -1341,7 +1341,7 @@
 	    compl_match_array[i].pum_kind = compl->cp_text[CPT_KIND];
 	    compl_match_array[i].pum_info = compl->cp_text[CPT_INFO];
 	    compl_match_array[i].pum_score = compl->cp_score;
-	    compl_match_array[i].pum_extrahlattr = compl->cp_extrahlattr;
+	    compl_match_array[i].pum_user_hlattr = compl->cp_user_hlattr;
 	    if (compl->cp_text[CPT_MENU] != NULL)
 		compl_match_array[i++].pum_extra =
 		    compl->cp_text[CPT_MENU];
@@ -2860,8 +2860,8 @@
     char_u	*(cptext[CPT_COUNT]);
     typval_T	user_data;
     int		status;
-    char_u	*extra_hlname;
-    int		extra_hlattr = -1;
+    char_u	*user_hlname;
+    int		user_hlattr = -1;
 
     user_data.v_type = VAR_UNKNOWN;
     if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
@@ -2871,9 +2871,9 @@
 	cptext[CPT_MENU] = dict_get_string(tv->vval.v_dict, "menu", FALSE);
 	cptext[CPT_KIND] = dict_get_string(tv->vval.v_dict, "kind", FALSE);
 	cptext[CPT_INFO] = dict_get_string(tv->vval.v_dict, "info", FALSE);
-	extra_hlname = dict_get_string(tv->vval.v_dict, "hl_group", FALSE);
-	if (extra_hlname != NULL && *extra_hlname != NUL)
-	    extra_hlattr = syn_name2attr(extra_hlname);
+	user_hlname = dict_get_string(tv->vval.v_dict, "hl_group", FALSE);
+	if (user_hlname != NULL && *user_hlname != NUL)
+	    user_hlattr = syn_name2attr(user_hlname);
 
 	dict_get_tv(tv->vval.v_dict, "user_data", &user_data);
 	if (dict_get_string(tv->vval.v_dict, "icase", FALSE) != NULL
@@ -2898,7 +2898,7 @@
 	return FAIL;
     }
     status = ins_compl_add(word, -1, NULL, cptext,
-				    &user_data, dir, flags, dup, extra_hlattr);
+				     &user_data, dir, flags, dup, user_hlattr);
     if (status != OK)
 	clear_tv(&user_data);
     return status;
diff --git a/src/popupmenu.c b/src/popupmenu.c
index b6bc1dc..4bc01a5 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -425,7 +425,7 @@
  * Returns attributes for every cell, or NULL if all attributes are the same.
  */
     static int *
-pum_compute_text_attrs(char_u *text, hlf_T hlf, int extra_hlattr)
+pum_compute_text_attrs(char_u *text, hlf_T hlf, int user_hlattr)
 {
     int		i;
     size_t	leader_len;
@@ -483,8 +483,8 @@
 	else if (matched_start && ptr < text + leader_len)
 	    new_attr = highlight_attr[hlf == HLF_PSI ? HLF_PMSI : HLF_PMNI];
 
-	if (extra_hlattr > 0)
-	    new_attr = hl_combine_attr(new_attr, extra_hlattr);
+	if (user_hlattr > 0)
+	    new_attr = hl_combine_attr(new_attr, user_hlattr);
 
 	char_cells = mb_ptr2cells(ptr);
 	for (i = 0; i < char_cells; i++)
@@ -631,8 +631,8 @@
 	{
 	    hlf = hlfs[round];
 	    attr = highlight_attr[hlf];
-	    if (pum_array[idx].pum_extrahlattr > 0)
-		attr = hl_combine_attr(attr, pum_array[idx].pum_extrahlattr);
+	    if (pum_array[idx].pum_user_hlattr > 0)
+		attr = hl_combine_attr(attr, pum_array[idx].pum_user_hlattr);
 	    width = 0;
 	    s = NULL;
 	    switch (round)
@@ -661,8 +661,8 @@
 			if (saved != NUL)
 			    *p = saved;
 
-			int extra_hlattr = pum_array[idx].pum_extrahlattr;
-			attrs = pum_compute_text_attrs(st, hlf, extra_hlattr);
+			int user_hlattr = pum_array[idx].pum_user_hlattr;
+			attrs = pum_compute_text_attrs(st, hlf, user_hlattr);
 
 #ifdef FEAT_RIGHTLEFT
 			if (pum_rl)
diff --git a/src/structs.h b/src/structs.h
index 2e8efa8..32c35b7 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -4472,7 +4472,7 @@
     char_u	*pum_info;	  // extra info
     int		pum_score;	  // fuzzy match score
     int		pum_idx;	  // index of item before sorting by score
-    int		pum_extrahlattr;  // extra highlight group attr for combine
+    int		pum_user_hlattr;  // highlight attribute to combine with
 } pumitem_T;
 
 /*
diff --git a/src/testdir/dumps/Test_pum_highlights_13.dump b/src/testdir/dumps/Test_pum_highlights_13.dump
new file mode 100644
index 0000000..34fde12
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_highlights_13.dump
@@ -0,0 +1,20 @@
+|a+0&#ffffff0|w|o|r|d|1> @68
+|a+8#ff404010#e0e0e08|w|o+0&&|r|d|1| |W| |e|x|t|r|a| |t|e|x|t| |1| | +0#4040ff13#ffffff0@52
+|a+8#0000e05#ffd7ff255|w|o+0#0000001&|r|d|2| |W| |e|x|t|r|a| |t|e|x|t| |2| | +0#4040ff13#ffffff0@52
+|你*0#ff404010#ffd7ff255|好| +&@2|W| |e|x|t|r|a| |t|e|x|t| |3| | +0#4040ff13#ffffff0@52
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@26
diff --git a/src/testdir/dumps/Test_pum_highlights_14.dump b/src/testdir/dumps/Test_pum_highlights_14.dump
new file mode 100644
index 0000000..f35b4cb
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_highlights_14.dump
@@ -0,0 +1,20 @@
+|a+0&#ffffff0|w|o|r|d|2> @68
+|a+8#ff404010#ffd7ff255|w|o+0&&|r|d|1| |W| |e|x|t|r|a| |t|e|x|t| |1| | +0#4040ff13#ffffff0@52
+|a+8#00e0e07#e0e0e08|w|o+0#0000001&|r|d|2| |W| |e|x|t|r|a| |t|e|x|t| |2| | +0#4040ff13#ffffff0@52
+|你*0#ff404010#ffd7ff255|好| +&@2|W| |e|x|t|r|a| |t|e|x|t| |3| | +0#4040ff13#ffffff0@52
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |2| |o|f| |3| +0#0000000&@26
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 67e600c..4c2fb45 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1499,10 +1499,9 @@
   call StopVimInTerminal(buf)
 endfunc
 
-func Test_pum_extrahl()
+func Test_pum_user_hl_group()
   CheckScreendump
   let lines =<< trim END
-    hi StrikeFake ctermfg=9
     func CompleteFunc( findstart, base )
       if a:findstart
         return 0
@@ -1516,15 +1515,31 @@
     endfunc
     set completeopt=menu
     set completefunc=CompleteFunc
+
+    hi StrikeFake ctermfg=9
+    func HlMatch()
+      hi PmenuMatchSel  ctermfg=6 ctermbg=7 cterm=underline
+      hi PmenuMatch     ctermfg=4 ctermbg=225 cterm=underline
+    endfunc
   END
   call writefile(lines, 'Xscript', 'D')
   let buf = RunVimInTerminal('-S Xscript', {})
+
   call TermWait(buf)
-  call term_sendkeys(buf, "iaw\<C-X>\<C-u>")
-  call TermWait(buf, 50)
+  call term_sendkeys(buf, "Saw\<C-X>\<C-U>")
   call VerifyScreenDump(buf, 'Test_pum_highlights_12', {})
-  call term_sendkeys(buf, "\<C-E>\<Esc>u")
+  call term_sendkeys(buf, "\<C-E>\<Esc>")
+
   call TermWait(buf)
+  call term_sendkeys(buf, ":call HlMatch()\<CR>")
+
+  call TermWait(buf)
+  call term_sendkeys(buf, "Saw\<C-X>\<C-U>")
+  call VerifyScreenDump(buf, 'Test_pum_highlights_13', {})
+  call term_sendkeys(buf, "\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_highlights_14', {})
+  call term_sendkeys(buf, "\<C-E>\<Esc>")
+
   call StopVimInTerminal(buf)
 endfunc
 
diff --git a/src/version.c b/src/version.c
index f2b7a19..a7b5405 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    629,
+/**/
     628,
 /**/
     627,