patch 9.0.1543: display errors when making topline shorter

Problem:    Display errors when making topline shorter and 'smoothscroll' is
            set.
Solution:   Reset w_skipcol when the topline becomes shorter than its current
            value. (Luuk van Baal, closes #12367)
diff --git a/src/change.c b/src/change.c
index e5798c5..8bb61ed 100644
--- a/src/change.c
+++ b/src/change.c
@@ -553,13 +553,25 @@
     {
 	if (wp->w_buffer == curbuf)
 	{
-#ifdef FEAT_FOLDING
 	    linenr_T last = lnume + xtra - 1;  // last line after the change
-#endif
+
 	    // Mark this window to be redrawn later.
 	    if (!redraw_not_allowed && wp->w_redr_type < UPD_VALID)
 		wp->w_redr_type = UPD_VALID;
 
+	    // Reset "w_skipcol" if the topline length has become smaller to
+	    // such a degree that nothing will be visible anymore, accounting
+	    // for 'smoothscroll' <<< or 'listchars' "precedes" marker.
+	    if (wp->w_skipcol > 0
+		    && (last < wp->w_topline
+			|| (wp->w_topline >= lnum
+			    && wp->w_topline < lnume
+			    && win_linetabsize(wp, wp->w_topline,
+					ml_get(wp->w_topline), (colnr_T)MAXCOL)
+				    <= wp->w_skipcol + (wp->w_p_list
+					    && wp->w_lcs_chars.prec ? 1 : 3))))
+		wp->w_skipcol = 0;
+
 	    // Check if a change in the buffer has invalidated the cached
 	    // values for the cursor.
 #ifdef FEAT_FOLDING