diff src/terminal.c @ 14029:d9fc15c833d5 v8.1.0032

patch 8.1.0032: BS in prompt buffer starts new line commit https://github.com/vim/vim/commit/6b810d92a9cd9378ab46ea0db07079cb789f9faa Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 4 17:28:44 2018 +0200 patch 8.1.0032: BS in prompt buffer starts new line 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.
author Christian Brabandt <cb@256bit.org>
date Mon, 04 Jun 2018 17:30:08 +0200
parents 59121ffd7fce
children e271ca6f32f9
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -5094,8 +5094,19 @@ f_term_sendkeys(typval_T *argvars, typva
 
     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);
     }
 }