degesch: split input text at newlines

This makes pasting multiline text possible again.
This commit is contained in:
Přemysl Eric Janouch 2015-11-15 15:56:33 +01:00
parent 9b22d72fd1
commit 281ef2e93e

View File

@ -8603,8 +8603,18 @@ process_input (struct app_context *ctx, char *user_input)
if (!(input = iconv_xstrdup (ctx->term_to_utf8, user_input, -1, NULL)))
print_error ("character conversion failed for `%s'", "user input");
else
// TODO: split at newlines?
(void) process_input_utf8 (ctx, ctx->current_buffer, input, 0);
{
struct str_vector lines;
str_vector_init (&lines);
// XXX: this interprets commands in pasted text
split_str (input, "\r\n", &lines);
for (size_t i = 0; i < lines.len; i++)
(void) process_input_utf8 (ctx,
ctx->current_buffer, lines.vector[i], 0);
str_vector_free (&lines);
}
free (input);
}