patch 9.1.1513: resizing Vim window causes unexpected internal window width

Problem:  resizing Vim window causes unexpected internal window width
          (chdiza, after v9.1.1465)
Solution: move the column calculation around (Hirohito Higashi)

fixes: #17657
fixes: #17595
closes: #17668

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/term.c b/src/term.c
index 720c8a0..c892c6d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3619,6 +3619,13 @@
     if (old_Rows != Rows || old_Columns != COLUMNS_WITHOUT_TPL()
 	    || old_coloff != TPL_LCOL())
 	ui_new_shellsize();
+    if (old_Columns != COLUMNS_WITHOUT_TPL() || old_coloff != TPL_LCOL())
+    {
+	old_Columns = COLUMNS_WITHOUT_TPL();
+	old_coloff = TPL_LCOL();
+
+	shell_new_columns();
+    }
     if (old_Rows != Rows)
     {
 	// If 'window' uses the whole screen, keep it using that.
@@ -3629,13 +3636,6 @@
 	old_Rows = Rows;
 	shell_new_rows();	// update window sizes
     }
-    if (old_Columns != COLUMNS_WITHOUT_TPL() || old_coloff != TPL_LCOL())
-    {
-	old_Columns = COLUMNS_WITHOUT_TPL();
-	old_coloff = TPL_LCOL();
-
-	shell_new_columns();
-    }
 }
 
 /*