mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Some fixes to drawing lines & handling long lines.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1958 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
806ab849bf
commit
8f65188776
@ -320,7 +320,7 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
|||||||
subline == 0 ? line->text : cache->lines[subline-1].start;
|
subline == 0 ? line->text : cache->lines[subline-1].start;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (text == text_newline) {
|
if (text == text_newline) {
|
||||||
if (need_clrtoeol && need_move) {
|
if (need_clrtoeol && xpos < term_width) {
|
||||||
term_set_color(view->window, ATTR_RESET);
|
term_set_color(view->window, ATTR_RESET);
|
||||||
term_clrtoeol(view->window);
|
term_clrtoeol(view->window);
|
||||||
}
|
}
|
||||||
@ -334,25 +334,27 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (subline > 0) {
|
if (subline > 0) {
|
||||||
indent_func = cache->lines[subline-1].indent_func;
|
/* continuing previous line - indent it */
|
||||||
|
indent_func = cache->lines[subline-1].indent_func;
|
||||||
xpos = indent_func != NULL ?
|
xpos = indent_func != NULL ?
|
||||||
indent_func(view, line, ypos) :
|
indent_func(view, line, ypos) :
|
||||||
cache->lines[subline-1].indent;
|
cache->lines[subline-1].indent;
|
||||||
color = cache->lines[subline-1].color;
|
color = cache->lines[subline-1].color;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_move || xpos > 0) {
|
if (xpos == 0)
|
||||||
/* first clear the line */
|
need_clrtoeol = TRUE;
|
||||||
if (xpos == 0)
|
else {
|
||||||
need_clrtoeol = TRUE;
|
/* line was indented - need to clear the
|
||||||
else {
|
indented area first */
|
||||||
term_set_color(view->window, ATTR_RESET);
|
term_set_color(view->window, ATTR_RESET);
|
||||||
term_move(view->window, 0, ypos);
|
term_move(view->window, 0, ypos);
|
||||||
term_clrtoeol(view->window);
|
term_clrtoeol(view->window);
|
||||||
}
|
|
||||||
|
|
||||||
term_move(view->window, xpos, ypos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (need_move || xpos > 0)
|
||||||
|
term_move(view->window, xpos, ypos);
|
||||||
|
|
||||||
term_set_color(view->window, color);
|
term_set_color(view->window, color);
|
||||||
|
|
||||||
if (subline == cache->count-1) {
|
if (subline == cache->count-1) {
|
||||||
@ -397,9 +399,10 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
|||||||
term_set_color(view->window, color);
|
term_set_color(view->window, color);
|
||||||
}
|
}
|
||||||
text++;
|
text++;
|
||||||
|
xpos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_clrtoeol) {
|
if (need_clrtoeol && xpos < term_width) {
|
||||||
term_set_color(view->window, ATTR_RESET);
|
term_set_color(view->window, ATTR_RESET);
|
||||||
term_clrtoeol(view->window);
|
term_clrtoeol(view->window);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user