patch 8.1.1823: command line history code is spread out

Problem:    Command line history code is spread out.
Solution:   Put the code in a new file. (Yegappan Lakshmanan, closes #4779)
            Also graduate the +cmdline_hist feature.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 98f5070..282e6a0 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3900,10 +3900,8 @@
 
 	if (!cmdmod.keeppatterns)
 	    save_re_pat(RE_SUBST, pat, p_magic);
-#ifdef FEAT_CMDHIST
-	/* put pattern in history */
+	// put pattern in history
 	add_to_history(HIST_SEARCH, pat, TRUE, NUL);
-#endif
 
 	return;
     }