aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--degesch.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index ea7eaf6..f6706a1 100644
--- a/degesch.c
+++ b/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)))
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);
}