patch 9.1.0280: several issues with 'smoothscroll' support

Problem:  Logic to make sure cursor is in visible part of the screen after
          scrolling the text with 'smoothscroll' is scattered, asymmetric
          and contains bugs.
Solution: Adjust and create helper function for 'smoothscroll' cursor logic.
          (Luuk van Baal)

closes: #14410

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/misc1.c b/src/misc1.c
index 666cd58..7ee4712 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -519,6 +519,8 @@
 #endif
 	{
 #ifdef FEAT_DIFF
+	    if (first == wp->w_buffer->b_ml.ml_line_count)
+		count += diff_check_fill(wp, first + 1);
 	    if (first == wp->w_topline)
 		count += plines_win_nofill(wp, first, limit_winheight)
 							       + wp->w_topfill;