patch 8.2.4479: no fuzzy completieon for maps and abbreviations

Problem:    No fuzzy completieon for maps and abbreviations.
Solution:   Fuzzy complete maps and abbreviations. (Yegappan Lakshmanan,
            closes #9856)
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 003f6da..84dc643 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -56,7 +56,6 @@
 	    && xp->xp_context != EXPAND_FILES_IN_PATH
 	    && xp->xp_context != EXPAND_FILETYPE
 	    && xp->xp_context != EXPAND_HELP
-	    && xp->xp_context != EXPAND_MAPPINGS
 	    && xp->xp_context != EXPAND_OLD_SETTING
 	    && xp->xp_context != EXPAND_OWNSYNTAX
 	    && xp->xp_context != EXPAND_PACKADD
@@ -1216,10 +1215,12 @@
 
     // Isolate the command and search for it in the command table.
     // Exceptions:
-    // - the 'k' command can directly be followed by any character, but
-    //   do accept "keepmarks", "keepalt" and "keepjumps".
+    // - the 'k' command can directly be followed by any character, but do
+    // accept "keepmarks", "keepalt" and "keepjumps". As fuzzy matching can
+    // find matches anywhere in the command name, do this only for command
+    // expansion based on regular expression and not for fuzzy matching.
     // - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
-    if (*cmd == 'k' && cmd[1] != 'e')
+    if (!fuzzy && (*cmd == 'k' && cmd[1] != 'e'))
     {
 	eap->cmdidx = CMD_k;
 	p = cmd + 1;
@@ -2596,7 +2597,7 @@
 	    || xp->xp_context == EXPAND_BOOL_SETTINGS)
 	ret = ExpandSettings(xp, &regmatch, pat, numMatches, matches);
     else if (xp->xp_context == EXPAND_MAPPINGS)
-	ret = ExpandMappings(&regmatch, numMatches, matches);
+	ret = ExpandMappings(pat, &regmatch, numMatches, matches);
 # if defined(FEAT_EVAL)
     else if (xp->xp_context == EXPAND_USER_DEFINED)
 	ret = ExpandUserDefined(xp, &regmatch, matches, numMatches);
@@ -2712,7 +2713,8 @@
 		fuzmatch = ALLOC_MULT(fuzmatch_str_T, count);
 	    else
 		*matches = ALLOC_MULT(char_u *, count);
-	    if ((fuzzy && (fuzmatch == NULL)) || (*matches == NULL))
+	    if ((!fuzzy && (*matches == NULL))
+					|| (fuzzy && (fuzmatch == NULL)))
 	    {
 		*numMatches = 0;
 		*matches = NULL;