diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-04-04 19:36:57 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-04-04 19:36:57 -0400 |
commit | 2007d299916be6b079e6b97aea7c4d2835e23bd0 (patch) | |
tree | e8c1fc1000f1822e49e7b724da373fe31166f88e /ted.c | |
parent | 36444b69593008f40ee2d0b47c894e37428435ae (diff) |
command to reload all buffers, run make on multiple threads
Diffstat (limited to 'ted.c')
-rw-r--r-- | ted.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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); + } +} |