From b9eda1adb6966121851c29fa7900e0706ac52d32 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 18 May 2002 11:51:04 +0000 Subject: [PATCH] External indent functions (theme_indent module) weren't working properly. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2815 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index da69734e..a3cbe460 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -343,13 +343,14 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, if (subline > 0) { /* continuing previous line - indent it */ indent_func = cache->lines[subline-1].indent_func; - xpos = indent_func != NULL ? - indent_func(view, line, ypos) : - cache->lines[subline-1].indent; + if (indent_func == NULL) + xpos = cache->lines[subline-1].indent; color = cache->lines[subline-1].color; + } else { + indent_func = NULL; } - if (xpos == 0) + if (xpos == 0 && indent_func == NULL) need_clrtoeol = TRUE; else { /* line was indented - need to clear the @@ -357,6 +358,9 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, term_set_color(view->window, ATTR_RESET); term_move(view->window, 0, ypos); term_clrtoeol(view->window); + + if (indent_func != NULL) + xpos = indent_func(view, line, ypos); } if (need_move || xpos > 0)