1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05: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) 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(window != NULL);
g_return_if_fail(line != NULL);
gui = WINDOW_GUI(window); 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->data == line)
gui->lastlog_last_away = NULL; 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 */ /* first line in screen removed */
gui->startline = gui->startline->next; if (gui->startline->next != NULL) {
gui->subline = 0; gui->startline = gui->startline->next;
gui->ypos--; gui->subline = 0;
} } else {
if (gui->bottom_startline->prev == NULL) { gui->startline = gui->startline->prev;
/* bottom line removed (shouldn't happen?) */ gui->subline = gui->last_subline+1;
gui->bottom_startline = gui->bottom_startline->next; gui->ypos = -1;
gui->bottom_subline = 0; }
}
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--; window->lines--;
g_mem_chunk_free(gui->line_chunk, line); g_mem_chunk_free(gui->line_chunk, line);
gui->lines = g_list_remove(gui->lines, line); gui->lines = g_list_remove(gui->lines, line);
if (gui->startline->prev == NULL && is_window_visible(window)) if (window->lines == 0)
gui_window_redraw(window); gui_window_clear(window);
if (screenchange && is_window_visible(window))
gui_window_redraw(window);
} }
static void remove_old_lines(WINDOW_REC *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; gui->eol_marked = FALSE;
line = create_line(gui, 0); line = create_line(gui, 0);
gui_window_newline(gui, visible && gui->temp_line == NULL); if (gui->temp_line == NULL || g_list_find(gui->startline, gui->temp_line) != NULL)
gui_window_newline(gui, visible);
gui->last_subline = 0; gui->last_subline = 0;
} else { } 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_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_remove(WINDOW_REC *window, LINE_REC *line);
void gui_window_line_text_free(GUI_WINDOW_REC *gui, LINE_REC *line);
#endif #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, '\0');
g_string_append_c(raw, (char)LINE_CMD_EOL); 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->temp_line->text = gui->cur_text->buffer+gui->cur_text->pos;
gui->cur_text->lines++;
gui->eol_marked = FALSE; gui->eol_marked = FALSE;
format_create_dest(&dest, NULL, NULL, line->level, window); format_create_dest(&dest, NULL, NULL, line->level, window);