@@ -798,12 +798,13 @@ cmdline_init(void)
798798}
799799
800800/*
801- * Handle the backslash key pressed in the command-line mode. CTRL-\ CTRL-N
802- * goes to Normal mode, CTRL-\ CTRL-G goes to Insert mode when 'insertmode' is
803- * set, CTRL-\ e prompts for an expression.
801+ * Handle CTRL-\ pressed in Command-line mode:
802+ * - CTRL-\ CTRL-N goes to Normal mode
803+ * - CTRL-\ CTRL-G goes to Insert mode when 'insertmode' is set
804+ * - CTRL-\ e prompts for an expression.
804805 */
805806 static int
806- cmdline_handle_backslash_key (int c , int * gotesc )
807+ cmdline_handle_ctrl_bsl (int c , int * gotesc )
807808{
808809 ++ no_mapping ;
809810 ++ allow_keys ;
@@ -832,8 +833,7 @@ cmdline_handle_backslash_key(int c, int *gotesc)
832833
833834 /*
834835 * Replace the command line with the result of an expression.
835- * Need to save and restore the current command line, to be
836- * able to enter a new one...
836+ * This will call getcmdline() recursively in get_expr_register().
837837 */
838838 if (ccline .cmdpos == ccline .cmdlen )
839839 new_cmdpos = 99999 ; // keep it at the end
@@ -843,9 +843,8 @@ cmdline_handle_backslash_key(int c, int *gotesc)
843843 c = get_expr_register ();
844844 if (c == '=' )
845845 {
846- // Need to save and restore ccline. And set "textlock"
847- // to avoid nasty things like going to another buffer when
848- // evaluating an expression.
846+ // Evaluate the expression. Set "textlock" to avoid nasty things
847+ // like going to another buffer.
849848 ++ textlock ;
850849 p = get_expr_line ();
851850 -- textlock ;
@@ -1909,15 +1908,15 @@ getcmdline_int(
19091908 // mode when 'insertmode' is set, CTRL-\ e prompts for an expression.
19101909 if (c == Ctrl_BSL )
19111910 {
1912- res = cmdline_handle_backslash_key (c , & gotesc );
1911+ res = cmdline_handle_ctrl_bsl (c , & gotesc );
19131912 if (res == CMDLINE_CHANGED )
19141913 goto cmdline_changed ;
19151914 else if (res == CMDLINE_NOT_CHANGED )
19161915 goto cmdline_not_changed ;
19171916 else if (res == GOTO_NORMAL_MODE )
19181917 goto returncmd ; // back to cmd mode
19191918 c = Ctrl_BSL ; // backslash key not processed by
1920- // cmdline_handle_backslash_key ()
1919+ // cmdline_handle_ctrl_bsl ()
19211920 }
19221921
19231922 if (c == cedit_key || c == K_CMDWIN )
0 commit comments