Yeah I actually wrote this up myself and added a really hacky hack to wait.
(This is just the wait part)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 | // TODO(Jim0_o 2019-02-18): Need a wait here for file changes to be finished by clang-format.
{
Buffer_Summary *Buffer = &buffer;
s32 BackupOutCounter = 0;
// NOTE(Jim0_o 2019-02-18): Waiting for 4Coder to mark buffer dirty.. 100x20 == 2 second max sleep.
while(BackupOutCounter < 20){
_sleep(100);
BackupOutCounter++; // LOG_DATA("BOC[%i]", BackupOutCounter);
Buffer_Summary FreshBuffer = get_buffer(app, view.buffer_id, AccessOpen);
Buffer = &FreshBuffer;
if(Buffer->dirty){ break; }
}
// HACK(Jim0_o 2019-02-18): Trying to workaround the still dirty thing.. (Hack inside a hack... such hackey.)
_sleep(100);
reopen_buffer(app, Buffer, AccessOpen);
}
|
I just loop for up to 2 seconds waiting (This hack does freezes 4Coder tho.) for the buffer to be be marked "dirty" (that means 4Coder has seen the file be changed outside of 4Coder). Tho I found that the file/buffer sometimes gets made dirty again after the reload... so I'm now thinking the changes are STILL being made when the buffer gets reloaded.
But yeah I asked Allen on the discord:
"Allen4th: @Jim0_o no there is no built in support for notifications from new child process output or completion."
So I guess the next step could be to use the libraries and calling the functions and updating the buffers manually.
I had been putting off adding clang-tools support into my customization, so manually updating a buffer with ctrl+shift+'O' is good enough for me for now.