summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-08-12 14:55:56 +0000
committerBram Moolenaar <Bram@vim.org>2007-08-12 14:55:56 +0000
commit67f7131efa985e51e2fe3f8be9524cc767f7d827 (patch)
treef227d71add7b5b45c081b49fc67487af487c771f /src/window.c
parenta2993e134077de960c3c450d31d9223230874c93 (diff)
downloadvim-git-67f7131efa985e51e2fe3f8be9524cc767f7d827.tar.gz
updated for version 7.1-068v7.1.068
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c49
1 files changed, 43 insertions, 6 deletions
diff --git a/src/window.c b/src/window.c
index 289197225..b94fc34a5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -733,7 +733,6 @@ win_split_ins(size, flags, newwin, dir)
if (flags & WSP_VERT)
{
layout = FR_ROW;
- do_equal = (p_ea && new_size == 0 && *p_ead != 'v');
/*
* Check if we are able to split the current window and compute its
@@ -770,16 +769,31 @@ win_split_ins(size, flags, newwin, dir)
* instead, if possible. */
if (oldwin->w_p_wfw)
win_setwidth_win(oldwin->w_width + new_size, oldwin);
+
+ /* Only make all windows the same width if one of them (except oldwin)
+ * is wider than one of the split windows. */
+ if (!do_equal && p_ea && size == 0 && *p_ead != 'v'
+ && oldwin->w_frame->fr_parent != NULL)
+ {
+ frp = oldwin->w_frame->fr_parent->fr_child;
+ while (frp != NULL)
+ {
+ if (frp->fr_win != oldwin && frp->fr_win != NULL
+ && (frp->fr_win->w_width > new_size
+ || frp->fr_win->w_width > oldwin->w_width
+ - new_size - STATUS_HEIGHT))
+ {
+ do_equal = TRUE;
+ break;
+ }
+ frp = frp->fr_next;
+ }
+ }
}
else
#endif
{
layout = FR_COL;
- do_equal = (p_ea && new_size == 0
-#ifdef FEAT_VERTSPLIT
- && *p_ead != 'h'
-#endif
- );
/*
* Check if we are able to split the current window and compute its
@@ -832,6 +846,29 @@ win_split_ins(size, flags, newwin, dir)
if (need_status)
oldwin_height -= STATUS_HEIGHT;
}
+
+ /* Only make all windows the same height if one of them (except oldwin)
+ * is higher than one of the split windows. */
+ if (!do_equal && p_ea && size == 0
+#ifdef FEAT_VERTSPLIT
+ && *p_ead != 'h'
+#endif
+ && oldwin->w_frame->fr_parent != NULL)
+ {
+ frp = oldwin->w_frame->fr_parent->fr_child;
+ while (frp != NULL)
+ {
+ if (frp->fr_win != oldwin && frp->fr_win != NULL
+ && (frp->fr_win->w_height > new_size
+ || frp->fr_win->w_height > oldwin_height - new_size
+ - STATUS_HEIGHT))
+ {
+ do_equal = TRUE;
+ break;
+ }
+ frp = frp->fr_next;
+ }
+ }
}
/*