From: Eli Zaretskii Date: Sun, 18 Sep 2011 16:17:40 +0000 (+0300) Subject: Fix a bug in :align-to on a TTY when the column is beyond frame width. X-Git-Tag: emacs-pretest-24.0.90~99 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c02dcedf1b2ab40e4d1ea55bac6923c3c5249e86;p=emacs.git Fix a bug in :align-to on a TTY when the column is beyond frame width. src/xdisp.c (produce_stretch_glyph): Don't subtract 1 "pixel" when computing width of the stretch on a TTY. --- diff --git a/src/ChangeLog b/src/ChangeLog index 09ac0d78e73..b81c5cf9792 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,9 @@ stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record buffer positions that will be removed from the glyph row because they don't fit. + (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the + column is beyond frame width: don't subtract 1 "pixel" when + computing width of the stretch. 2011-09-18 YAMAMOTO Mitsuharu diff --git a/src/xdisp.c b/src/xdisp.c index b2859d0767b..97d59644b15 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23293,7 +23293,14 @@ produce_stretch_glyph (struct it *it) if (width > 0 && it->line_wrap != TRUNCATE && it->current_x + width > it->last_visible_x) - width = it->last_visible_x - it->current_x - 1; + { + width = it->last_visible_x - it->current_x; +#ifdef HAVE_WINDOW_SYSTEM + /* Subtact one more pixel from the stretch width, but only on + GUI frames, since on a TTY each glyph is one "pixel" wide. */ + width -= FRAME_WINDOW_P (it->f); +#endif + } if (width > 0 && height > 0 && it->glyph_row) {