diff src/evalfunc.c @ 15615:536fca2cee19 v8.1.0815

patch 8.1.0815: dialog for file changed outside of Vim not tested commit https://github.com/vim/vim/commit/5e66b42aae7c67a3ef67617d4bd43052ac2b73ce Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 21:58:10 2019 +0100 patch 8.1.0815: dialog for file changed outside of Vim not tested Problem: Dialog for file changed outside of Vim not tested. Solution: Add a test. Move FileChangedShell test. Add 'L' flag to feedkeys().
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 22:00:05 +0100
parents 1ec942f1b648
children 6f1c7e9a6393
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -3674,6 +3674,7 @@ f_feedkeys(typval_T *argvars, typval_T *
     int		typed = FALSE;
     int		execute = FALSE;
     int		dangerous = FALSE;
+    int		lowlevel = FALSE;
     char_u	*keys_esc;
 
     /* This is not allowed in the sandbox.  If the commands would still be
@@ -3697,6 +3698,7 @@ f_feedkeys(typval_T *argvars, typval_T *
 		case 'i': insert = TRUE; break;
 		case 'x': execute = TRUE; break;
 		case '!': dangerous = TRUE; break;
+		case 'L': lowlevel = TRUE; break;
 	    }
 	}
     }
@@ -3708,7 +3710,16 @@ f_feedkeys(typval_T *argvars, typval_T *
 	keys_esc = vim_strsave_escape_csi(keys);
 	if (keys_esc != NULL)
 	{
-	    ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
+	    if (lowlevel)
+	    {
+#ifdef USE_INPUT_BUF
+		add_to_input_buf(keys, (int)STRLEN(keys));
+#else
+		emsg(_("E980: lowlevel input not supported"));
+#endif
+	    }
+	    else
+		ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
 				  insert ? 0 : typebuf.tb_len, !typed, FALSE);
 	    vim_free(keys_esc);
 	    if (vgetc_busy