vim-patch:9.0.1038: function name does not match what it is used for (#21359)

Problem:    Function name does not match what it is used for.
Solution:   Include the modifier in the name. (closes vim/vim#11679)

ffa4e9b43a
This commit is contained in:
zeertzjq 2022-12-09 20:09:03 +08:00 committed by GitHub
parent 5e6a288ce7
commit 3cf0131c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -939,10 +939,10 @@ static int command_line_check(VimState *state)
return 1;
}
/// Handle the backslash key pressed in the command-line mode.
/// CTRL-\ CTRL-N or CTRL-\ CTRL-G goes to Normal mode,
/// CTRL-\ e prompts for an expression.
static int command_line_handle_backslash_key(CommandLineState *s)
/// Handle CTRL-\ pressed in Command-line mode:
/// - CTRL-\ CTRL-N or CTRL-\ CTRL-G goes to Normal mode.
/// - CTRL-\ e prompts for an expression.
static int command_line_handle_ctrl_bsl(CommandLineState *s)
{
no_mapping++;
allow_keys++;
@ -963,6 +963,7 @@ static int command_line_handle_backslash_key(CommandLineState *s)
if (s->c == 'e') {
// Replace the command line with the result of an expression.
// This will call getcmdline() recursively in get_expr_register().
if (ccline.cmdpos == ccline.cmdlen) {
new_cmdpos = 99999; // keep it at the end
} else {
@ -971,9 +972,8 @@ static int command_line_handle_backslash_key(CommandLineState *s)
s->c = get_expr_register();
if (s->c == '=') {
// Need to save and restore ccline. And set "textlock"
// to avoid nasty things like going to another buffer when
// evaluating an expression.
// Evaluate the expression. Set "textlock" to avoid nasty things
// like going to another buffer.
textlock++;
char *p = get_expr_line();
textlock--;
@ -1244,7 +1244,7 @@ static int command_line_execute(VimState *state, int key)
// CTRL-\ CTRL-N or CTRL-\ CTRL-G goes to Normal mode,
// CTRL-\ e prompts for an expression.
if (s->c == Ctrl_BSL) {
switch (command_line_handle_backslash_key(s)) {
switch (command_line_handle_ctrl_bsl(s)) {
case CMDLINE_CHANGED:
return command_line_changed(s);
case CMDLINE_NOT_CHANGED:
@ -1253,7 +1253,7 @@ static int command_line_execute(VimState *state, int key)
return 0; // back to cmd mode
default:
s->c = Ctrl_BSL; // backslash key not processed by
// cmdline_handle_backslash_key()
// command_line_handle_ctrl_bsl()
}
}