aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2014-09-16 19:23:11 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2014-09-16 22:51:16 +0900
commitf5320f645b325546f13289a708ba2efce3204c87 (patch)
tree5a251a50eaa9bd655e8c2fe7eca5f535aba36a0c /src
parent3b7b79e37d3479633701ad1d2ea4912d5c17c93b (diff)
downloadrneovim-f5320f645b325546f13289a708ba2efce3204c87.tar.gz
rneovim-f5320f645b325546f13289a708ba2efce3204c87.tar.bz2
rneovim-f5320f645b325546f13289a708ba2efce3204c87.zip
vim-patch:7.4.368
Problem: Restoring the window sizes after closing the command line window doesn't work properly if there are nested splits. Solution: Restore the sizes twice. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=v7-4-368
Diffstat (limited to 'src')
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/window.c13
2 files changed, 10 insertions, 5 deletions
diff --git a/src/nvim/version.c b/src/nvim/version.c
index b32da8937e..c93fc5083c 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -227,7 +227,7 @@ static int included_patches[] = {
371,
370,
//369,
- //368,
+ 368,
367,
//366,
//365,
diff --git a/src/nvim/window.c b/src/nvim/window.c
index b9714ce690..dccf3e2efc 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -3800,10 +3800,15 @@ void win_size_save(garray_T *gap)
void win_size_restore(garray_T *gap)
{
if (win_count() * 2 == gap->ga_len) {
- int i = 0;
- FOR_ALL_WINDOWS(wp) {
- frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
- win_setheight_win(((int *)gap->ga_data)[i++], wp);
+ /* The order matters, because frames contain other frames, but it's
+ * difficult to get right. The easy way out is to do it twice. */
+ for (int j = 0; j < 2; ++j)
+ {
+ int i = 0;
+ FOR_ALL_WINDOWS(wp) {
+ frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
+ win_setheight_win(((int *)gap->ga_data)[i++], wp);
+ }
}
/* recompute the window positions */
(void)win_comp_pos();