Skip to content

Commit

Permalink
msg: skip formatting if there is only control char present
Browse files Browse the repository at this point in the history
This doesn't change behaviour just skips some redundant code early.
  • Loading branch information
kasper93 committed Oct 20, 2024
1 parent 33040d6 commit 8164783
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,10 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out)

if (lev == MSGL_STATUS) {
int line_w = 0;
bool clip = bstr_eatstart0(&str, TERM_MSG_0);
if (str.len && print_term)
append_terminal_line(log, lev, str, &root->term_msg_tmp, &line_w,
bstr_eatstart0(&str, TERM_MSG_0) && term_w ? term_w : INT_MAX);
clip && term_w ? term_w : INT_MAX);
term_msg_lines += !term_w ? (str.len ? 1 : 0)
: (line_w + term_w - 1) / term_w;
} else if (str.len) {
Expand Down

0 comments on commit 8164783

Please sign in to comment.