mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
Fix some display bugs with read marker line, history, max prefix length, and chat refresh (bug #23153)
Some info about bugs fixed: - when marker line (dotted) was on top of window (and not visible), this caused bug on last lines of buffer (not refreshed) - marker line is not set for a buffer after a switch, only if buffer it not displayed in other window - when we delete lines in a buffer (if lines > weechat.history.max_lines), we force a full refresh of chat if remaining lines is < to chat height and we compute again max prefix length for buffer (before max prefix length was always incremented, never decremented)
This commit is contained in:
@@ -142,7 +142,7 @@ gui_chat_get_real_width (struct t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_chat_marker_for_line: return 1 if marker must be displayed before this
|
||||
* gui_chat_marker_for_line: return 1 if marker must be displayed after this
|
||||
* line, or 0 if it must not
|
||||
*/
|
||||
|
||||
@@ -158,7 +158,6 @@ gui_chat_marker_for_line (struct t_gui_buffer *buffer, struct t_gui_line *line)
|
||||
&& (CONFIG_INTEGER(config_look_read_marker) != CONFIG_LOOK_READ_MARKER_DOTTED_LINE))
|
||||
return 0;
|
||||
|
||||
line = line->prev_line;
|
||||
while (line)
|
||||
{
|
||||
if (buffer->last_read_line == line)
|
||||
@@ -167,7 +166,7 @@ gui_chat_marker_for_line (struct t_gui_buffer *buffer, struct t_gui_line *line)
|
||||
if (line->displayed)
|
||||
break;
|
||||
|
||||
line = line->prev_line;
|
||||
line = line->next_line;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -804,14 +803,6 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
|
||||
|
||||
marker_line = gui_chat_marker_for_line (window->buffer, line);
|
||||
|
||||
if (marker_line)
|
||||
{
|
||||
gui_chat_display_horizontal_line (window, simulate);
|
||||
gui_chat_display_new_line (window, num_lines, count,
|
||||
&lines_displayed, simulate);
|
||||
lines_displayed--;
|
||||
}
|
||||
|
||||
/* display time and prefix */
|
||||
gui_chat_display_time_and_prefix (window, line, num_lines, count,
|
||||
&lines_displayed, simulate);
|
||||
@@ -904,6 +895,13 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
|
||||
}
|
||||
}
|
||||
|
||||
if (marker_line && gui_chat_get_next_line_displayed (line))
|
||||
{
|
||||
gui_chat_display_horizontal_line (window, simulate);
|
||||
gui_chat_display_new_line (window, num_lines, count,
|
||||
&lines_displayed, simulate);
|
||||
}
|
||||
|
||||
if (simulate)
|
||||
{
|
||||
window->win_chat_cursor_x = x;
|
||||
@@ -940,9 +938,6 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
|
||||
}
|
||||
}
|
||||
|
||||
if (marker_line)
|
||||
lines_displayed++;
|
||||
|
||||
return lines_displayed;
|
||||
}
|
||||
|
||||
|
||||
@@ -633,7 +633,8 @@ gui_window_switch_to_buffer (struct t_gui_window *window,
|
||||
{
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
window->buffer->last_read_line = window->buffer->last_line;
|
||||
if (window->buffer->num_displayed == 0)
|
||||
window->buffer->last_read_line = window->buffer->last_line;
|
||||
if (buffer->last_read_line == buffer->last_line)
|
||||
buffer->last_read_line = NULL;
|
||||
gui_previous_buffer = window->buffer;
|
||||
|
||||
Reference in New Issue
Block a user