aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Möllmann2025-03-27 06:10:46 +0100
committerGerd Möllmann2025-03-27 06:10:46 +0100
commit1883a5c7174eeede8fe307e73014628edca6b614 (patch)
tree1af7830f803299ceae32944f29363a2c3b2d3a62 /src
parentc00170e92c5c3f68734e0e2d632d6efdcbb9c969 (diff)
downloademacs-1883a5c7174eeede8fe307e73014628edca6b614.tar.gz
emacs-1883a5c7174eeede8fe307e73014628edca6b614.zip
Don't write to bottom-right cell on ttys with AutoWrap (bug#77233)
* src/term.c (tty_write_glyphs): Handle case of writing only one character in the last column.
Diffstat (limited to 'src')
-rw-r--r--src/term.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/term.c b/src/term.c
index 864f86aa730..8aa47322d19 100644
--- a/src/term.c
+++ b/src/term.c
@@ -977,10 +977,20 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
977 if (AutoWrap (tty) 977 if (AutoWrap (tty)
978 && curY (tty) + 1 == FRAME_TOTAL_LINES (f) 978 && curY (tty) + 1 == FRAME_TOTAL_LINES (f)
979 && curX (tty) + len == FRAME_COLS (f) 979 && curX (tty) + len == FRAME_COLS (f)
980 && curX (tty) < FRAME_COLS (f) - 1
981 && len > 0) 980 && len > 0)
982 { 981 {
983 /* Write glyphs except the first. */ 982 /* If writing only one glyph in the last column, make that two so
983 that we can shift that one glyph into the last column. FIXME:
984 Assuming a display width of 1 looks questionable, but that's
985 done everywhere else involving auto-wrap. */
986 if (len == 1)
987 {
988 cmgoto (tty, curY (tty), curX (tty) - 1);
989 --string;
990 ++len;
991 }
992
993 /* Write glyphs except the first. */
984 int old_x = curX (tty), old_y = curY (tty); 994 int old_x = curX (tty), old_y = curY (tty);
985 tty_write_glyphs_1 (f, string + 1, len - 1); 995 tty_write_glyphs_1 (f, string + 1, len - 1);
986 996