degesch: split input text at newlines
This makes pasting multiline text possible again.
This commit is contained in:
parent
9b22d72fd1
commit
281ef2e93e
14
degesch.c
14
degesch.c
|
@ -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)))
|
if (!(input = iconv_xstrdup (ctx->term_to_utf8, user_input, -1, NULL)))
|
||||||
print_error ("character conversion failed for `%s'", "user input");
|
print_error ("character conversion failed for `%s'", "user input");
|
||||||
else
|
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);
|
free (input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue