summaryrefslogtreecommitdiff
path: root/src/fe-text/term-terminfo.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-29 19:13:52 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-29 19:13:52 +0000
commit3cdedf5b4b5c2281074838f2bf240f6e3a5940b8 (patch)
tree90ffb83ec3dd887dbaef06563a0039dde1076fc1 /src/fe-text/term-terminfo.c
parent2500457729c6a7bd2235118679860d2e59d356df (diff)
downloadirssi-3cdedf5b4b5c2281074838f2bf240f6e3a5940b8.zip
terminfo's term_clrtoeol() uses the clrtoeol() command only when using the default colors. otherwise it just goes and fills the line with spaces.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1941 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/term-terminfo.c')
-rw-r--r--src/fe-text/term-terminfo.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index f17e354f..56ae53c1 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -177,9 +177,13 @@ void term_window_clear(TERM_WINDOW *window)
int y;
terminfo_set_normal();
- for (y = 0; y < window->height; y++) {
- term_move(window, 0, y);
- term_clrtoeol(window);
+ if (window->y == 0 && window->height == term_height) {
+ term_clear();
+ } else {
+ for (y = 0; y < window->height; y++) {
+ term_move(window, 0, y);
+ term_clrtoeol(window);
+ }
}
}
@@ -280,7 +284,15 @@ void term_addstr(TERM_WINDOW *window, char *str)
void term_clrtoeol(TERM_WINDOW *window)
{
- terminfo_clrtoeol();
+ if (last_fg == -1 && last_bg == -1 &&
+ (last_attrs & (ATTR_UNDERLINE|ATTR_REVERSE)) == 0) {
+ /* clrtoeol() doesn't necessarily understand colors */
+ terminfo_clrtoeol();
+ } else if (vcx < term_width) {
+ /* we'll need to fill the line ourself. */
+ terminfo_repeat(' ', term_width-vcx);
+ terminfo_move(vcx, vcy);
+ }
}
void term_move_cursor(int x, int y)