summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-04-04 19:36:57 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-04-04 19:36:57 -0400
commit2007d299916be6b079e6b97aea7c4d2835e23bd0 (patch)
treee8c1fc1000f1822e49e7b724da373fe31166f88e /ted.c
parent36444b69593008f40ee2d0b47c894e37428435ae (diff)
command to reload all buffers, run make on multiple threads
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ted.c b/ted.c
index bd3ac46..91471b4 100644
--- a/ted.c
+++ b/ted.c
@@ -1,4 +1,5 @@
static void menu_open(Ted *ted, Menu menu);
+static void menu_close(Ted *ted);
static void find_update(Ted *ted, bool force);
static Command command_from_str(char const *str);
@@ -317,3 +318,18 @@ static bool ted_save_all(Ted *ted) {
}
return success;
}
+
+static void ted_reload_all(Ted *ted) {
+ bool *buffers_used = ted->buffers_used;
+ for (u64 i = 0; i < TED_MAX_BUFFERS; ++i) {
+ if (buffers_used[i]) {
+ TextBuffer *buffer = &ted->buffers[i];
+ if (!buffer_unsaved_changes(buffer)) {
+ buffer_reload(buffer);
+ }
+ }
+ }
+ if (ted->menu == MENU_ASK_RELOAD) {
+ menu_close(ted);
+ }
+}