From 34c127babe34f5ac6d1876bdea809049d2b88af8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 27 May 2000 14:51:58 +0000 Subject: Long lines sometimes had some colors displayed wrong. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@246 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-windows.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fe-text/gui-windows.c b/src/fe-text/gui-windows.c index 47595953..6c949886 100644 --- a/src/fe-text/gui-windows.c +++ b/src/fe-text/gui-windows.c @@ -227,14 +227,14 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line LINE_CACHE_SUB_REC *sub; GSList *lines; unsigned char *ptr, *last_space_ptr; - int xpos, pos, indent_pos, last_space, color; + int xpos, pos, indent_pos, last_space, last_color, color; g_return_val_if_fail(line->text != NULL, NULL); rec = g_new(LINE_CACHE_REC, 1); xpos = 0; color = 0; indent_pos = DEFAULT_INDENT_POS; - last_space = 0; last_space_ptr = NULL; + last_space = last_color = 0; last_space_ptr = NULL; rec->count = 1; lines = NULL; for (ptr = (unsigned char *) line->text;;) { @@ -281,6 +281,7 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line if (last_space > indent_pos && last_space > 10) { /* go back to last space */ + color = last_color; ptr = last_space_ptr; while (*ptr == ' ') ptr++; } @@ -301,6 +302,7 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line if (*ptr++ == ' ') { last_space = xpos-1; last_space_ptr = ptr; + last_color = color; } } -- cgit v1.2.3