aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-09 20:09:03 +0800
committerGitHub <noreply@github.com>2022-12-09 20:09:03 +0800
commit3cf0131c5cc6e9d9df0c632646e39301f107e5a8 (patch)
tree75df0a1de4d932442bfda7c1c82fea99a2f381dc
parent5e6a288ce7ee079e7695525f2e9e99d071ccdfbf (diff)
downloadrneovim-3cf0131c5cc6e9d9df0c632646e39301f107e5a8.tar.gz
rneovim-3cf0131c5cc6e9d9df0c632646e39301f107e5a8.tar.bz2
rneovim-3cf0131c5cc6e9d9df0c632646e39301f107e5a8.zip
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) https://github.com/vim/vim/commit/ffa4e9b43a3d6d7f412f54637a4b1076ed2bc2f4
-rw-r--r--src/nvim/ex_getln.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index ace43db98b..8fd7cb08f0 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -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()
}
}