History

msg: fix clipped output to non-tty

Not sure how it got lost.

Kacper Michajłow committed 2 years ago

Commit b026fde1 parent 6aa33121 file · +2 −2Browse files

Unified · Split

common/msg.c+2−2
@@ -525,7 +525,7 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) · 524 unmodified lines
525 if (print_term) {525 if (print_term) {
526 int line_w;526 int line_w;
527 append_terminal_line(log, lev, line, &root->term_msg_tmp, &line_w,527 append_terminal_line(log, lev, line, &root->term_msg_tmp, &line_w,
528 clip ? term_w : INT_MAX);528 clip && term_w ? term_w : INT_MAX);
529 term_msg_lines += (!line_w || !term_w)529 term_msg_lines += (!line_w || !term_w)
530 ? 1 : (line_w + term_w - 1) / term_w;530 ? 1 : (line_w + term_w - 1) / term_w;
531 }531 }
@@ -536,7 +536,7 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) · 4 unmodified lines
536 int line_w = 0;536 int line_w = 0;
537 if (str.len && print_term)537 if (str.len && print_term)
538 append_terminal_line(log, lev, str, &root->term_msg_tmp, &line_w,538 append_terminal_line(log, lev, str, &root->term_msg_tmp, &line_w,
539 bstr_eatstart0(&str, TERM_MSG_0) ? term_w : INT_MAX);539 bstr_eatstart0(&str, TERM_MSG_0) && term_w ? term_w : INT_MAX);
540 term_msg_lines += !term_w ? (str.len ? 1 : 0)540 term_msg_lines += !term_w ? (str.len ? 1 : 0)
541 : (line_w + term_w - 1) / term_w;541 : (line_w + term_w - 1) / term_w;
542 } else if (str.len) {542 } else if (str.len) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t