diff src/evalbuffer.c @ 30160:fbf6084346cc v9.0.0416

patch 9.0.0416: ml_get error when appending lines in popup window Commit: https://github.com/vim/vim/commit/58a3cae3eb590c375bf4823052e8d9d4165050de Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 8 13:43:10 2022 +0100 patch 9.0.0416: ml_get error when appending lines in popup window Problem: ml_get error when appending lines in popup window. Solution: Only update w_topline when w_buffer matches curbuf. (closes #11074)
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Sep 2022 14:45:09 +0200
parents 6c7eddcce52c
children 6d2095a8499d
line wrap: on
line diff
--- a/src/evalbuffer.c
+++ b/src/evalbuffer.c
@@ -254,7 +254,11 @@ set_buffer_lines(
 		    && wp->w_cursor.lnum > append_lnum)
 		wp->w_cursor.lnum += added;
 	check_cursor_col();
-	update_topline();
+
+	// Only update the window view if w_buffer matches curbuf, otherwise
+	// the computations will be wrong.
+	if (curwin->w_buffer == curbuf)
+	    update_topline();
     }
 
 done: