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:
parent
df94b9a44c
commit
085b938dd3
@ -170,8 +170,10 @@ 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,23 +185,40 @@ 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 */
|
||||||
|
if (gui->startline->next != NULL) {
|
||||||
gui->startline = gui->startline->next;
|
gui->startline = gui->startline->next;
|
||||||
gui->subline = 0;
|
gui->subline = 0;
|
||||||
gui->ypos--;
|
} else {
|
||||||
|
gui->startline = gui->startline->prev;
|
||||||
|
gui->subline = gui->last_subline+1;
|
||||||
|
gui->ypos = -1;
|
||||||
}
|
}
|
||||||
if (gui->bottom_startline->prev == NULL) {
|
}
|
||||||
/* bottom line removed (shouldn't happen?) */
|
|
||||||
|
if (gui->bottom_startline->data == line) {
|
||||||
|
/* bottom line removed */
|
||||||
|
if (gui->bottom_startline->next != NULL) {
|
||||||
gui->bottom_startline = gui->bottom_startline->next;
|
gui->bottom_startline = gui->bottom_startline->next;
|
||||||
gui->bottom_subline = 0;
|
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_clear(window);
|
||||||
|
|
||||||
|
if (screenchange && is_window_visible(window))
|
||||||
gui_window_redraw(window);
|
gui_window_redraw(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +377,8 @@ 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 {
|
||||||
|
@ -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
|
||||||
|
@ -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_window_line_text_free(gui, line);
|
||||||
|
|
||||||
gui->temp_line = 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user