aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-25 22:57:45 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-25 23:09:51 -0400
commit28ac4a99f270fa866fa025a858ff6a503ef81a24 (patch)
treed8cea66afe41427a38abad4e2ded67b6a6e84f7c
parent8240b8b596da48215d0e6032e587cd6242e6f014 (diff)
downloadrneovim-28ac4a99f270fa866fa025a858ff6a503ef81a24.tar.gz
rneovim-28ac4a99f270fa866fa025a858ff6a503ef81a24.tar.bz2
rneovim-28ac4a99f270fa866fa025a858ff6a503ef81a24.zip
vim-patch:8.1.0433: mapping can obtain text from inputsecret()
Problem: Mapping can obtain text from inputsecret(). (Tommy Allen) Solution: Disallow CTRL-R = and CTRL-\ e when using inputsecret(). https://github.com/vim/vim/commit/31cbadf74bccc2a5cd8233bc31bbcfe466b00021
-rw-r--r--src/nvim/ex_getln.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 9be61f0740..e0a4f78083 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -793,9 +793,11 @@ static int command_line_execute(VimState *state, int key)
no_mapping--;
// CTRL-\ e doesn't work when obtaining an expression, unless it
// is in a mapping.
- if (s->c != Ctrl_N && s->c != Ctrl_G && (s->c != 'e'
- || (ccline.cmdfirstc == '='
- && KeyTyped))) {
+ if (s->c != Ctrl_N
+ && s->c != Ctrl_G
+ && (s->c != 'e'
+ || (ccline.cmdfirstc == '=' && KeyTyped)
+ || cmdline_star)) {
vungetc(s->c);
s->c = Ctrl_BSL;
} else if (s->c == 'e') {
@@ -1350,7 +1352,8 @@ static int command_line_handle_key(CommandLineState *s)
// a new one...
new_cmdpos = -1;
if (s->c == '=') {
- if (ccline.cmdfirstc == '=') { // can't do this recursively
+ if (ccline.cmdfirstc == '=' // can't do this recursively
+ || cmdline_star) { // or when typing a password
beep_flush();
s->c = ESC;
} else {