aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authoroni-link <knil.ino@gmail.com>2014-05-22 11:20:45 +0200
committerJustin M. Keyes <justinkz@gmail.com>2014-06-05 18:16:59 -0400
commit29eb651a92ded3e3f008d6853f3df6693f296576 (patch)
tree09cc22d5252bbf9d28a4de9efc3f5a1d64cf00db /src/nvim/ex_docmd.c
parentfee0e2d977264cd21c9f833937dd56e3ffd4ea60 (diff)
downloadrneovim-29eb651a92ded3e3f008d6853f3df6693f296576.tar.gz
rneovim-29eb651a92ded3e3f008d6853f3df6693f296576.tar.bz2
rneovim-29eb651a92ded3e3f008d6853f3df6693f296576.zip
vim-patch:7.4.281 #746
Problem: When a session file has more than one tabpage and 'showtabline' is one the positions may be slightly off. Solution: Set 'showtabline' to two while positioning windows. https://code.google.com/p/vim/source/detail?r=24c90f1fec859b54cf2b854b98c4c9e614c46061
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 9102ba63bb..e8930bd0f6 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -7974,6 +7974,17 @@ makeopens (
return FAIL;
}
+ int restore_stal = FALSE;
+ // When there are two or more tabpages and 'showtabline' is 1 the tabline
+ // will be displayed when creating the next tab. That resizes the windows
+ // in the first tab, which may cause problems. Set 'showtabline' to 2
+ // temporarily to avoid that.
+ if (p_stal == 1 && first_tabpage->tp_next != NULL) {
+ if (put_line(fd, "set stal=2") == FAIL) {
+ return FAIL;
+ }
+ restore_stal = TRUE;
+ }
/*
* May repeat putting Windows for each tab, when "tabpages" is in
@@ -8113,6 +8124,9 @@ makeopens (
|| put_eol(fd) == FAIL)
return FAIL;
}
+ if (restore_stal && put_line(fd, "set stal=1") == FAIL) {
+ return FAIL;
+ }
/*
* Wipe out an empty unnamed buffer we started in.