updated for version 7.0213
diff --git a/src/buffer.c b/src/buffer.c
index 5d3ddd6..4e5e037 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3633,7 +3633,7 @@
 		str = tmp;
 	    break;
 	case STL_PAGENUM:
-#if defined(FEAT_PRINTER) || defined(FEAT_WINDOWS)
+#if defined(FEAT_PRINTER) || defined(FEAT_GUI_TABLINE)
 	    num = printer_page_num;
 #else
 	    num = 0;
@@ -4448,16 +4448,17 @@
 	for (wp = firstwin; wp != NULL; wp = wpnext)
 	{
 	    wpnext = wp->w_next;
-	    if (wp->w_buffer->b_nwindows > 1
+	    if ((wp->w_buffer->b_nwindows > 1
 #ifdef FEAT_VERTSPLIT
 		    || ((cmdmod.split & WSP_VERT)
 			? wp->w_height + wp->w_status_height < Rows - p_ch
+							    - tabline_height()
 			: wp->w_width != Columns)
 #endif
 #ifdef FEAT_WINDOWS
 		    || (had_tab > 0 && wp != firstwin)
 #endif
-		    )
+		    ) && firstwin != lastwin)
 	    {
 		win_close(wp, FALSE);
 #ifdef FEAT_AUTOCMD
diff --git a/src/gui.c b/src/gui.c
index 7b6e38b..0a2286b 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -3097,7 +3097,6 @@
     int		using_toolbar = FALSE;
 #endif
 #ifdef FEAT_GUI_TABLINE
-    static int	prev_has_tabline = FALSE;
     int		using_tabline;
 #endif
 #ifdef FEAT_FOOTER
@@ -3199,9 +3198,8 @@
 	/* Update the GUI tab line, it may appear or disappear.  This may
 	 * cause the non-GUI tab line to disappear or appear. */
 	using_tabline = gui_has_tabline();
-	if (prev_has_tabline != using_tabline)
+	if (!gui_mch_showing_tabline() != !using_tabline)
 	{
-	    prev_has_tabline = using_tabline;
 	    gui_update_tabline();
 	    need_set_size = TRUE;
 	    if (using_tabline)
@@ -3369,6 +3367,7 @@
 	int	use_sandbox = FALSE;
 	int	save_called_emsg = called_emsg;
 	char_u	res[MAXPATHL];
+	tabpage_T *save_curtab;
 
 	called_emsg = FALSE;
 
@@ -3377,12 +3376,31 @@
 	set_vim_var_nr(VV_LNUM, printer_page_num);
 	use_sandbox = was_set_insecurely((char_u *)"guitablabel", 0);
 # endif
+	/* It's almost as going to the tabpage, but without autocommands. */
+	curtab->tp_firstwin = firstwin;
+	curtab->tp_lastwin = lastwin;
+	curtab->tp_curwin = curwin;
+	save_curtab = curtab;
+	curtab = tp;
+	topframe = curtab->tp_topframe;
+	firstwin = curtab->tp_firstwin;
+	lastwin = curtab->tp_lastwin;
+	curwin = curtab->tp_curwin;
+	curbuf = curwin->w_buffer;
+
 	/* Can't use NameBuff directly, build_stl_str_hl() uses it. */
-	build_stl_str_hl(tp == curtab ? curwin : tp->tp_curwin,
-		res, MAXPATHL, p_gtl, use_sandbox,
-		0, (int)Columns, NULL, NULL);
+	build_stl_str_hl(curwin, res, MAXPATHL, p_gtl, use_sandbox,
+						 0, (int)Columns, NULL, NULL);
 	STRCPY(NameBuff, res);
 
+	/* Back to the original curtab. */
+	curtab = save_curtab;
+	topframe = curtab->tp_topframe;
+	firstwin = curtab->tp_firstwin;
+	lastwin = curtab->tp_lastwin;
+	curwin = curtab->tp_curwin;
+	curbuf = curwin->w_buffer;
+
 	if (called_emsg)
 	    set_string_option_direct((char_u *)"guitablabel", -1,
 					   (char_u *)"", OPT_FREE, SID_ERROR);
diff --git a/src/mark.c b/src/mark.c
index 98550b3..8a3d108 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -39,13 +39,27 @@
 #endif
 
 /*
- * Set named mark 'c' at current cursor position.
+ * Set named mark "c" at current cursor position.
  * Returns OK on success, FAIL if bad name given.
  */
     int
 setmark(c)
     int		c;
 {
+    return setmark_pos(c, &curwin->w_cursor, curbuf->b_fnum);
+}
+
+/*
+ * Set named mark "c" to position "pos".
+ * When "c" is upper case use file "fnum".
+ * Returns OK on success, FAIL if bad name given.
+ */
+    int
+setmark_pos(c, pos, fnum)
+    int		c;
+    pos_T	*pos;
+    int		fnum;
+{
     int		i;
 
     /* Check for a special key (may cause islower() to crash). */
@@ -54,9 +68,14 @@
 
     if (c == '\'' || c == '`')
     {
-	setpcmark();
-	/* keep it even when the cursor doesn't move */
-	curwin->w_prev_pcmark = curwin->w_pcmark;
+	if (pos == &curwin->w_cursor)
+	{
+	    setpcmark();
+	    /* keep it even when the cursor doesn't move */
+	    curwin->w_prev_pcmark = curwin->w_pcmark;
+	}
+	else
+	    curwin->w_pcmark = *pos;
 	return OK;
     }
 
@@ -64,12 +83,12 @@
      * file. */
     if (c == '[')
     {
-	curbuf->b_op_start = curwin->w_cursor;
+	curbuf->b_op_start = *pos;
 	return OK;
     }
     if (c == ']')
     {
-	curbuf->b_op_end = curwin->w_cursor;
+	curbuf->b_op_end = *pos;
 	return OK;
     }
 
@@ -81,14 +100,14 @@
     if (islower(c))
     {
 	i = c - 'a';
-	curbuf->b_namedm[i] = curwin->w_cursor;
+	curbuf->b_namedm[i] = *pos;
 	return OK;
     }
     if (isupper(c))
     {
 	i = c - 'A';
-	namedfm[i].fmark.mark = curwin->w_cursor;
-	namedfm[i].fmark.fnum = curbuf->b_fnum;
+	namedfm[i].fmark.mark = *pos;
+	namedfm[i].fmark.fnum = fnum;
 	vim_free(namedfm[i].fname);
 	namedfm[i].fname = NULL;
 	return OK;
@@ -267,6 +286,9 @@
 
 /*
  * Find mark "c".
+ * If "changefile" is TRUE it's allowed to edit another file for '0, 'A, etc.
+ * If "fnum" is not NULL store the fnum there for '0, 'A etc., don't edit
+ * another file.
  * Returns:
  * - pointer to pos_T if found.  lnum is 0 when mark not set, -1 when mark is
  *   in another file which can't be gotten. (caller needs to check lnum!)
@@ -276,7 +298,16 @@
     pos_T *
 getmark(c, changefile)
     int		c;
-    int		changefile;		/* allowed to edit another file */
+    int		changefile;
+{
+    return getmark_fnum(c, changefile, NULL);
+}
+
+    pos_T *
+getmark_fnum(c, changefile, fnum)
+    int		c;
+    int		changefile;
+    int		*fnum;
 {
     pos_T		*posp;
 #ifdef FEAT_VISUAL
@@ -382,11 +413,14 @@
 
 	if (namedfm[c].fmark.fnum == 0)
 	    fname2fnum(&namedfm[c]);
-	if (namedfm[c].fmark.fnum != curbuf->b_fnum)
+
+	if (fnum != NULL)
+	    *fnum = namedfm[c].fmark.fnum;
+	else if (namedfm[c].fmark.fnum != curbuf->b_fnum)
 	{
+	    /* mark is in another file */
 	    posp = &pos_copy;
 
-	    /* mark is in another file */
 	    if (namedfm[c].fmark.mark.lnum != 0
 				       && changefile && namedfm[c].fmark.fnum)
 	    {
diff --git a/src/proto/gui_gtk_x11.pro b/src/proto/gui_gtk_x11.pro
index 30bde6a..afb384e 100644
--- a/src/proto/gui_gtk_x11.pro
+++ b/src/proto/gui_gtk_x11.pro
@@ -6,6 +6,7 @@
 void gui_mch_start_blink __ARGS((void));
 int gui_mch_init_check __ARGS((void));
 void gui_mch_show_tabline __ARGS((int showit));
+int gui_mch_showing_tabline __ARGS((void));
 void gui_mch_update_tabline __ARGS((void));
 void gui_mch_set_curtab __ARGS((int nr));
 int gui_mch_init __ARGS((void));
diff --git a/src/proto/mark.pro b/src/proto/mark.pro
index 040f08b..13e1868 100644
--- a/src/proto/mark.pro
+++ b/src/proto/mark.pro
@@ -1,10 +1,12 @@
 /* mark.c */
 int setmark __ARGS((int c));
+int setmark_pos __ARGS((int c, pos_T *pos, int fnum));
 void setpcmark __ARGS((void));
 void checkpcmark __ARGS((void));
 pos_T *movemark __ARGS((int count));
 pos_T *movechangelist __ARGS((int count));
 pos_T *getmark __ARGS((int c, int changefile));
+pos_T *getmark_fnum __ARGS((int c, int changefile, int *fnum));
 pos_T *getnextmark __ARGS((pos_T *startpos, int dir, int begin_line));
 void fmarks_check_names __ARGS((buf_T *buf));
 int check_mark __ARGS((pos_T *pos));