Skip to content

Commit

Permalink
Fix instances where bottom bar did not flush output
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Nov 21, 2021
1 parent 6a57efe commit c68c2b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ddhx/ddhx.d
Original file line number Diff line number Diff line change
Expand Up @@ -649,21 +649,22 @@ uint ddhxDrawRaw() {
* Message once (upper bar)
* Params: msg = Message string
*/
void ddhxMsgTop(A ...)(string fmt, A args) {
void ddhxMsgTop(A...)(string fmt, A args) {
conpos(0, 0);
ddhxMsg(fmt, args);
}

void ddhxMsgLow(A ...)(string fmt, A args) {
void ddhxMsgLow(A...)(string fmt, A args) {
conpos(0, conheight - 1);
ddhxMsg(fmt, args);
}

private void ddhxMsg(A ...)(string fmt, A args) {
private void ddhxMsg(A...)(string fmt, A args) {
import std.format : sformat;
char[256] outbuf = void;
char[] outs = outbuf[].sformat(fmt, args);
writef("%s%*s", outs, (conwidth - 1) - outs.length, " ");
stdout.flush();
}

/// Print some file information at the bottom bar
Expand Down

0 comments on commit c68c2b1

Please sign in to comment.