[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 740849f: Ensure positive number of glyphs for mar
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 740849f: Ensure positive number of glyphs for margins of positive width |
Date: |
Fri, 15 Jan 2016 15:38:05 +0000 |
branch: emacs-25
commit 740849fe986b62a839bce4bbf67d0036fc1be0b9
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Ensure positive number of glyphs for margins of positive width
* src/dispnew.c (margin_glyphs_to_reserve): Always return a
positive value when a non-zero width of the marginal area was
requested. (Bug#22356)
---
src/dispnew.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/dispnew.c b/src/dispnew.c
index 8d671f8..3e1557f 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -320,7 +320,9 @@ margin_glyphs_to_reserve (struct window *w, int
total_glyphs, int margin)
int width = w->total_cols;
double d = max (0, margin);
d = min (width / 2 - 1, d);
- return (int) ((double) total_glyphs / width * d);
+ /* Since MARGIN is positive, we cannot possibly have less than
+ one glyph for the marginal area. */
+ return max (1, (int) ((double) total_glyphs / width * d));
}
return 0;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 740849f: Ensure positive number of glyphs for margins of positive width,
Eli Zaretskii <=