patch 8.2.2198: ml_get error when resizing window and using text property

Problem:    ml_get error when resizing window and using text property.
Solution:   Validate botline of the right window. (closes #7528)
diff --git a/src/move.c b/src/move.c
index 69091fd..aa90b52 100644
--- a/src/move.c
+++ b/src/move.c
@@ -541,6 +541,8 @@
 #endif
     // Approximate the value of w_botline
     wp->w_botline += lnum - wp->w_topline;
+    if (wp->w_botline > wp->w_buffer->b_ml.ml_line_count + 1)
+	wp->w_botline = wp->w_buffer->b_ml.ml_line_count + 1;
     wp->w_topline = lnum;
     wp->w_topline_was_set = TRUE;
 #ifdef FEAT_DIFF
@@ -595,8 +597,17 @@
     void
 validate_botline(void)
 {
-    if (!(curwin->w_valid & VALID_BOTLINE))
-	comp_botline(curwin);
+    validate_botline_win(curwin);
+}
+
+/*
+ * Make sure the value of wp->w_botline is valid.
+ */
+    void
+validate_botline_win(win_T *wp)
+{
+    if (!(wp->w_valid & VALID_BOTLINE))
+	comp_botline(wp);
 }
 
 /*
diff --git a/src/proto/move.pro b/src/proto/move.pro
index 8efecb9..d78623a 100644
--- a/src/proto/move.pro
+++ b/src/proto/move.pro
@@ -13,6 +13,7 @@
 void changed_line_abv_curs(void);
 void changed_line_abv_curs_win(win_T *wp);
 void validate_botline(void);
+void validate_botline_win(win_T *wp);
 void invalidate_botline(void);
 void invalidate_botline_win(win_T *wp);
 void approximate_botline_win(win_T *wp);
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 0720567..a4033fa 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1358,4 +1358,24 @@
   call prop_type_delete('test')
 endfunc
 
+" this was causing an ml_get error because w_botline was wrong
+func Test_prop_one_line_window()
+  enew
+  call range(2)->setline(1)
+  call prop_type_add('testprop', {})
+  call prop_add(1, 1, {'type': 'testprop'})
+  call popup_create('popup', {'textprop': 'testprop'})
+  $
+  new
+  wincmd _
+  call feedkeys("\r", 'xt')
+  redraw
+
+  call popup_clear()
+  call prop_type_delete('testprop')
+  close
+  bwipe!
+endfunc
+
+
 " vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/textprop.c b/src/textprop.c
index 5a18f6c..b6cae70 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -419,7 +419,7 @@
     int			i;
 
     // w_botline may not have been updated yet.
-    validate_botline();
+    validate_botline_win(wp);
     for (lnum = wp->w_topline; lnum < wp->w_botline; ++lnum)
     {
 	count = get_text_props(wp->w_buffer, lnum, &props, FALSE);
diff --git a/src/version.c b/src/version.c
index 493194f..af89c9e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2198,
+/**/
     2197,
 /**/
     2196,