[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/window.c
From: |
Jan Dj�rv |
Subject: |
[Emacs-diffs] Changes to emacs/src/window.c |
Date: |
Sun, 14 Nov 2004 07:05:03 -0500 |
Index: emacs/src/window.c
diff -c emacs/src/window.c:1.484 emacs/src/window.c:1.485
*** emacs/src/window.c:1.484 Fri Nov 12 14:26:53 2004
--- emacs/src/window.c Sun Nov 14 11:59:21 2004
***************
*** 2657,2662 ****
--- 2657,2665 ----
--shrinkable;
total_removed += smallest;
+ /* We don't know what the smallest is now. */
+ smallest = total;
+
/* Out of for, just remove one window at the time and
check again if we have enough space. */
break;
***************
*** 2681,2686 ****
--- 2684,2699 ----
that are left and still can be shrunk. */
while (total_shrink > total_removed)
{
+ int nonzero_sizes = 0;
+ int nonzero_idx = -1;
+
+ for (i = 0; i < nchildren; ++i)
+ if (new_sizes[i] > 0)
+ {
+ ++nonzero_sizes;
+ nonzero_idx = i;
+ }
+
for (i = 0; i < nchildren; ++i)
if (new_sizes[i] > min_size)
{
***************
*** 2691,2696 ****
--- 2704,2728 ----
check again if we have enough space. */
break;
}
+
+
+ /* Special case, only one window left. */
+ if (nonzero_sizes == 1)
+ break;
+ }
+
+ /* Any surplus due to rounding, we add to windows that are left. */
+ while (total_shrink < total_removed)
+ {
+ for (i = 0; i < nchildren; ++i)
+ {
+ if (new_sizes[i] != 0 && total_shrink < total_removed)
+ {
+ ++new_sizes[i];
+ --total_removed;
+ break;
+ }
+ }
}
return new_sizes;
- [Emacs-diffs] Changes to emacs/src/window.c, Richard M . Stallman, 2004/11/02
- [Emacs-diffs] Changes to emacs/src/window.c, Andreas Schwab, 2004/11/02
- [Emacs-diffs] Changes to emacs/src/window.c, Kim F . Storm, 2004/11/09
- [Emacs-diffs] Changes to emacs/src/window.c, Kim F . Storm, 2004/11/12
- [Emacs-diffs] Changes to emacs/src/window.c,
Jan Dj�rv <=
- [Emacs-diffs] Changes to emacs/src/window.c, Stefan Monnier, 2004/11/16
- [Emacs-diffs] Changes to emacs/src/window.c, Kim F . Storm, 2004/11/22
- [Emacs-diffs] Changes to emacs/src/window.c, Stefan Monnier, 2004/11/23