1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

/SB REDRAW fixes, multiline formats should work now correctly.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@923 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-12-02 20:34:00 +00:00 committed by cras
parent df94b9a44c
commit 085b938dd3
3 changed files with 39 additions and 15 deletions

View File

@ -169,9 +169,11 @@ void gui_window_line_text_free(GUI_WINDOW_REC *gui, LINE_REC *line)
void gui_window_line_remove(WINDOW_REC *window, LINE_REC *line)
{
GUI_WINDOW_REC *gui;
GUI_WINDOW_REC *gui;
int screenchange;
g_return_if_fail(window != NULL);
g_return_if_fail(line != NULL);
gui = WINDOW_GUI(window);
@ -183,24 +185,41 @@ void gui_window_line_remove(WINDOW_REC *window, LINE_REC *line)
gui->lastlog_last_away->data == line)
gui->lastlog_last_away = NULL;
if (gui->startline->prev == NULL) {
screenchange = g_list_find(gui->startline, line) != NULL;
if (screenchange) gui->ypos--;
if (gui->startline->data == line) {
/* first line in screen removed */
gui->startline = gui->startline->next;
gui->subline = 0;
gui->ypos--;
}
if (gui->bottom_startline->prev == NULL) {
/* bottom line removed (shouldn't happen?) */
gui->bottom_startline = gui->bottom_startline->next;
gui->bottom_subline = 0;
if (gui->startline->next != NULL) {
gui->startline = gui->startline->next;
gui->subline = 0;
} else {
gui->startline = gui->startline->prev;
gui->subline = gui->last_subline+1;
gui->ypos = -1;
}
}
if (gui->bottom_startline->data == line) {
/* bottom line removed */
if (gui->bottom_startline->next != NULL) {
gui->bottom_startline = gui->bottom_startline->next;
gui->bottom_subline = 0;
} else {
gui->bottom_startline = gui->bottom_startline->prev;
gui->bottom_subline = gui->last_subline+1;
}
}
window->lines--;
g_mem_chunk_free(gui->line_chunk, line);
gui->lines = g_list_remove(gui->lines, line);
if (gui->startline->prev == NULL && is_window_visible(window))
gui_window_redraw(window);
if (window->lines == 0)
gui_window_clear(window);
if (screenchange && is_window_visible(window))
gui_window_redraw(window);
}
static void remove_old_lines(WINDOW_REC *window)
@ -357,8 +376,9 @@ static void gui_printtext(WINDOW_REC *window, void *fgcolor, void *bgcolor,
}
gui->eol_marked = FALSE;
line = create_line(gui, 0);
gui_window_newline(gui, visible && gui->temp_line == NULL);
line = create_line(gui, 0);
if (gui->temp_line == NULL || g_list_find(gui->startline, gui->temp_line) != NULL)
gui_window_newline(gui, visible);
gui->last_subline = 0;
} else {

View File

@ -31,5 +31,6 @@ void gui_printtext_deinit(void);
void gui_window_line_append(GUI_WINDOW_REC *gui, const char *str, int len);
void gui_window_line_remove(WINDOW_REC *window, LINE_REC *line);
void gui_window_line_text_free(GUI_WINDOW_REC *gui, LINE_REC *line);
#endif

View File

@ -1035,8 +1035,11 @@ void gui_window_reformat_line(WINDOW_REC *window, LINE_REC *line)
g_string_append_c(raw, '\0');
g_string_append_c(raw, (char)LINE_CMD_EOL);
gui->temp_line = line;
gui_window_line_text_free(gui, line);
gui->temp_line = line;
gui->temp_line->text = gui->cur_text->buffer+gui->cur_text->pos;
gui->cur_text->lines++;
gui->eol_marked = FALSE;
format_create_dest(&dest, NULL, NULL, line->level, window);