summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-22 21:27:13 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-22 21:27:13 +0100
commit57a6bf056715bd5c94d8047247615e39862424e7 (patch)
treea4384495a96aaa20b11390cba57362d4b638bed0
parent555de4e3b2881b0d9a72242ecc2ba26b5c698c85 (diff)
downloadvim-git-8.1.0790.tar.gz
patch 8.1.0790: code for creating tabpages in session is too complexv8.1.0790
Problem: Code for creating tabpages in session is too complex. Solution: Simplify the code. (Jason Franklin)
-rw-r--r--src/ex_docmd.c24
-rw-r--r--src/version.c2
2 files changed, 8 insertions, 18 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 387d26d15..62f507c2b 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -11401,26 +11401,14 @@ makeopens(
tab_topframe = topframe;
if ((ssop_flags & SSOP_TABPAGES))
{
- int num_tabs;
+ tabpage_T *tp;
- /*
- * Similar to ses_win_rec() below, populate the tab pages first so
- * later local options won't be copied to the new tabs.
- */
- for (tabnr = 1; ; ++tabnr)
- {
- tabpage_T *tp = find_tabpage(tabnr);
-
- if (tp == NULL) /* done all tab pages */
- break;
-
- if (tabnr > 1 && put_line(fd, "tabnew") == FAIL)
+ // Similar to ses_win_rec() below, populate the tab pages first so
+ // later local options won't be copied to the new tabs.
+ FOR_ALL_TABPAGES(tp)
+ if (tp->tp_next != NULL && put_line(fd, "tabnew") == FAIL)
return FAIL;
- }
-
- num_tabs = tabnr - 1;
- if (num_tabs > 1 && (fprintf(fd, "tabnext -%d", num_tabs - 1) < 0
- || put_eol(fd) == FAIL))
+ if (first_tabpage->tp_next != NULL && put_line(fd, "tabrewind") == FAIL)
return FAIL;
}
for (tabnr = 1; ; ++tabnr)
diff --git a/src/version.c b/src/version.c
index 364739738..8d2050f62 100644
--- a/src/version.c
+++ b/src/version.c
@@ -792,6 +792,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 790,
+/**/
789,
/**/
788,