summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/gui/gui-input.c19
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2864d63c8..b6d8f670f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Version 0.4.1 (under dev!)
--------------------------
+* core: reset scroll in window before zooming on a merged buffer (bug #38207)
* core: install icon file (patch #7972)
* core: fix refresh of item "completion": clear it after any action that is
changing content of command line and after switch of buffer (bug #38214)
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c
index 37afcb8e4..73158b737 100644
--- a/src/gui/gui-input.c
+++ b/src/gui/gui-input.c
@@ -1510,19 +1510,30 @@ gui_input_switch_active_buffer_previous (struct t_gui_buffer *buffer)
void
gui_input_zoom_merged_buffer (struct t_gui_buffer *buffer)
{
- struct t_gui_window *window;
+ struct t_gui_window *ptr_window;
/* do nothing if current buffer is not merged with another buffer */
if (gui_buffer_count_merged_buffers (buffer->number) < 2)
return;
+ /* reset scroll in all windows displaying this buffer number */
+ for (ptr_window = gui_windows; ptr_window;
+ ptr_window = ptr_window->next_window)
+ {
+ if ((ptr_window->buffer->number == buffer->number)
+ && ptr_window->scroll && ptr_window->scroll->start_line)
+ {
+ gui_window_scroll_bottom (ptr_window);
+ }
+ }
+
/* first make buffer active if it is not */
if (!buffer->active)
{
gui_buffer_set_active_buffer (buffer);
- window = gui_window_search_with_buffer (buffer);
- if (window)
- gui_window_switch_to_buffer (window, buffer, 1);
+ ptr_window = gui_window_search_with_buffer (buffer);
+ if (ptr_window)
+ gui_window_switch_to_buffer (ptr_window, buffer, 1);
}
/*