432 |
char saved_char_end, saved_char; |
char saved_char_end, saved_char; |
433 |
int end_of_word, chars_to_display, num_displayed; |
int end_of_word, chars_to_display, num_displayed; |
434 |
|
|
435 |
if (window->win_chat_cursor_y > window->win_chat_height - 1) |
if (!message || !end_msg || |
436 |
|
(window->win_chat_cursor_y > window->win_chat_height - 1)) |
437 |
return; |
return; |
438 |
|
|
439 |
snprintf (format_align, 32, "%%-%ds", line->length_align); |
snprintf (format_align, 32, "%%-%ds", line->length_align); |
618 |
&word_end_msg, &word_end_offset, |
&word_end_msg, &word_end_offset, |
619 |
&word_length_with_spaces, &word_length); |
&word_length_with_spaces, &word_length); |
620 |
|
|
621 |
/* spaces + word too long for current line */ |
if (word_length > 0) |
|
if ((window->win_chat_cursor_x + word_length_with_spaces > window->win_chat_width - 1) |
|
|
&& (word_length < window->win_chat_width - line->length_align)) |
|
622 |
{ |
{ |
623 |
gui_display_new_line (window, num_lines, count, |
/* spaces + word too long for current line */ |
624 |
&lines_displayed, simulate); |
if ((window->win_chat_cursor_x + word_length_with_spaces > window->win_chat_width - 1) |
625 |
ptr_message = word_start_msg; |
&& (word_length < window->win_chat_width - line->length_align)) |
626 |
offset = word_start_offset; |
{ |
627 |
|
gui_display_new_line (window, num_lines, count, |
628 |
|
&lines_displayed, simulate); |
629 |
|
ptr_message = word_start_msg; |
630 |
|
offset = word_start_offset; |
631 |
|
} |
632 |
|
|
633 |
|
/* word is exactly width => we'll skip next leading spaces for next line */ |
634 |
|
if (word_length == window->win_chat_width - line->length_align) |
635 |
|
skip_spaces = 1; |
636 |
|
|
637 |
|
/* display word */ |
638 |
|
gui_display_word (window, line, |
639 |
|
ptr_message, offset, |
640 |
|
word_end_msg, word_end_offset, |
641 |
|
num_lines, count, &lines_displayed, simulate); |
642 |
|
|
643 |
|
/* move pointer after end of word */ |
644 |
|
ptr_message = word_end_msg; |
645 |
|
offset = word_end_offset; |
646 |
|
gui_message_get_next_char (&ptr_message, &offset); |
647 |
|
|
648 |
|
/* skip leading spaces? */ |
649 |
|
if (skip_spaces) |
650 |
|
{ |
651 |
|
while (ptr_message && (ptr_message->message[offset] == ' ')) |
652 |
|
gui_message_get_next_char (&ptr_message, &offset); |
653 |
|
} |
654 |
} |
} |
655 |
|
else |
|
/* word is exactly width => we'll skip next leading spaces for next line */ |
|
|
if (word_length == window->win_chat_width - line->length_align) |
|
|
skip_spaces = 1; |
|
|
|
|
|
/* display word */ |
|
|
gui_display_word (window, line, |
|
|
ptr_message, offset, |
|
|
word_end_msg, word_end_offset, |
|
|
num_lines, count, &lines_displayed, simulate); |
|
|
|
|
|
/* move pointer after end of word */ |
|
|
ptr_message = word_end_msg; |
|
|
offset = word_end_offset; |
|
|
gui_message_get_next_char (&ptr_message, &offset); |
|
|
|
|
|
/* skip leading spaces? */ |
|
|
if (skip_spaces) |
|
656 |
{ |
{ |
657 |
while (ptr_message && (ptr_message->message[offset] == ' ')) |
gui_display_new_line (window, num_lines, count, |
658 |
gui_message_get_next_char (&ptr_message, &offset); |
&lines_displayed, simulate); |
659 |
|
ptr_message = NULL; |
660 |
} |
} |
661 |
} |
} |
662 |
|
|