mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00
vim-patch:8.1.0790: code for creating tabpages in session is too complex
Problem: Code for creating tabpages in session is too complex.
Solution: Simplify the code. (Jason Franklin)
57a6bf0567
This commit is contained in:
@@ -613,21 +613,13 @@ static int makeopens(FILE *fd, char_u *dirnow)
|
|||||||
if ((ssop_flags & SSOP_TABPAGES)) {
|
if ((ssop_flags & SSOP_TABPAGES)) {
|
||||||
// Similar to ses_win_rec() below, populate the tab pages first so
|
// Similar to ses_win_rec() below, populate the tab pages first so
|
||||||
// later local options won't be copied to the new tabs.
|
// later local options won't be copied to the new tabs.
|
||||||
for (tabnr = 1;; tabnr++) {
|
FOR_ALL_TABS(tp) {
|
||||||
const tabpage_T *const tp = find_tabpage(tabnr);
|
if (tp->tp_next != NULL && put_line(fd, "tabnew") == FAIL) {
|
||||||
|
|
||||||
if (tp == NULL) { // done all tab pages
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (tabnr > 1 && put_line(fd, "tabnew") == FAIL) {
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int num_tabs = tabnr - 1;
|
if (first_tabpage->tp_next != NULL && put_line(fd, "tabrewind") == FAIL) {
|
||||||
if (num_tabs > 1
|
|
||||||
&& (fprintf(fd, "tabnext -%d", num_tabs - 1) < 0
|
|
||||||
|| put_eol(fd) == FAIL)) {
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user