From: Guillermo J. Rozas Date: Fri, 30 Jul 1993 06:20:17 +0000 (+0000) Subject: Fix line-wrapping. It dropped characters and did not invalidate X-Git-Tag: 20090517-FFI~8164 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=21fc1c05256ce7a16394ba6d8e8f2adff735a3ac;p=mit-scheme.git Fix line-wrapping. It dropped characters and did not invalidate correctly. --- diff --git a/v7/src/microcode/ntscreen.c b/v7/src/microcode/ntscreen.c index 4e548db14..58940a338 100644 --- a/v7/src/microcode/ntscreen.c +++ b/v7/src/microcode/ntscreen.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ntscreen.c,v 1.5 1993/07/28 20:29:07 gjr Exp $ +$Id: ntscreen.c,v 1.6 1993/07/30 06:20:17 gjr Exp $ Copyright (c) 1993 Massachusetts Institute of Technology @@ -1623,6 +1623,33 @@ static VOID _fastcall Screen_WriteCharUninterpreted (SCREEN screen, int ch, struct screen_write_char_s * rectp) { + /* Line wrap/overwrite the last position */ + + if (screen->column >= screen->width) + { + if (screen->mode_flags & SCREEN_MODE_AUTOWRAP) + { + if ((rectp != ((struct screen_write_char_s *) NULL)) + && (rectp->row != -1)) + { + InvalidateRect (screen->hWnd, &rectp->rect, FALSE); + rectp->row = -1; + } + Screen_CR (screen); + if (! (screen->mode_flags & SCREEN_MODE_NEWLINE)) + Screen_LF (screen); + } + else + { + screen->column -= 1; + if (rectp != ((struct screen_write_char_s *) NULL)) + { + rectp->col -= 1; + rectp->rect.right -= screen->xChar; + } + } + } + screen->chars[screen->row * MAXCOLS + screen->column] = ch; screen->attrs[screen->row * MAXCOLS + screen->column] = screen->write_attribute; @@ -1653,19 +1680,7 @@ Screen_WriteCharUninterpreted (SCREEN screen, int ch, rectp->col = (screen->column + 1); rectp->row = screen->row; } - - /* Line wrap */ screen->column += 1; - if (screen->column >= screen->width) - { - screen->column -= 1; - if (screen->mode_flags & SCREEN_MODE_AUTOWRAP) - { - Screen_CR (screen); - if (! (screen->mode_flags & SCREEN_MODE_NEWLINE)) - Screen_LF (screen); - } - } return; }