diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-06-04 17:28:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-06-04 17:28:44 +0200 |
commit | 6b810d92a9cd9378ab46ea0db07079cb789f9faa (patch) | |
tree | 3d1f644261263fa755234cdab14a717c2647ca12 /src/terminal.c | |
parent | c8523e2e6cd072d86a9412f465aa9eef53f5675e (diff) | |
download | vim-git-6b810d92a9cd9378ab46ea0db07079cb789f9faa.tar.gz |
patch 8.1.0032: BS in prompt buffer starts new linev8.1.0032
Problem: BS in prompt buffer starts new line.
Solution: Do not allows BS over the prompt. Make term_sendkeys() handle
special keys. Add a test.
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c index 6967df73c..275a5a7ba 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -5094,8 +5094,19 @@ f_term_sendkeys(typval_T *argvars, typval_T *rettv) while (*msg != NUL) { - send_keys_to_term(term, PTR2CHAR(msg), FALSE); - msg += MB_CPTR2LEN(msg); + int c; + + if (*msg == K_SPECIAL && msg[1] != NUL && msg[2] != NUL) + { + c = TO_SPECIAL(msg[1], msg[2]); + msg += 3; + } + else + { + c = PTR2CHAR(msg); + msg += MB_CPTR2LEN(msg); + } + send_keys_to_term(term, c, FALSE); } } |