summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-18 15:14:02 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-18 15:14:02 -0500
commit5fa8e041356038034327ade41545677dd3007679 (patch)
tree9f6d8b729b163a55d93bf6d6b0775af6778cb087 /build.c
parent8f039627ab777d2b08c0c46d5acacbe84817d20f (diff)
Finishing touches for v. 0.4
Diffstat (limited to 'build.c')
-rw-r--r--build.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/build.c b/build.c
index 0112c0c..515709e 100644
--- a/build.c
+++ b/build.c
@@ -58,12 +58,17 @@ static void build_start(Ted *ted) {
if (process_run(&ted->build_process, command)) {
ted->building = true;
ted->build_shown = true;
+ TextBuffer *build_buffer = &ted->build_buffer;
// new empty build output buffer
- buffer_new_file(&ted->build_buffer, NULL);
- ted->build_buffer.store_undo_events = false; // don't need undo events for build output buffer
- ted->build_buffer.view_only = true;
+ buffer_new_file(build_buffer, NULL);
+ build_buffer->store_undo_events = false; // don't need undo events for build output buffer
+ char32_t text[] = {'$', ' '};
+ buffer_insert_text_at_cursor(build_buffer, str32(text, 2));
+ buffer_insert_utf8_at_cursor(build_buffer, command);
+ buffer_insert_char_at_cursor(build_buffer, '\n');
+ build_buffer->view_only = true;
} else {
- ted_seterr("Couldn't start build: %s", process_geterr(&ted->build_process));
+ ted_seterr(ted, "Couldn't start build: %s", process_geterr(&ted->build_process));
}
}
@@ -293,3 +298,4 @@ static void build_frame(Ted *ted, float x1, float y1, float x2, float y2) {
}
buffer_render(buffer, rect4(x1, y1, x2, y2));
}
+