diff options
-rw-r--r-- | editors/vi.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/editors/vi.c b/editors/vi.c index ce261feca..38177dec4 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -722,20 +722,25 @@ static void screen_erase(void) | |||
722 | memset(screen, ' ', screensize); // clear new screen | 722 | memset(screen, ' ', screensize); // clear new screen |
723 | } | 723 | } |
724 | 724 | ||
725 | static char *new_screen(int ro, int co) | 725 | static void new_screen(int ro, int co) |
726 | { | 726 | { |
727 | int li; | 727 | char *s; |
728 | 728 | ||
729 | free(screen); | 729 | free(screen); |
730 | screensize = ro * co + 8; | 730 | screensize = ro * co + 8; |
731 | screen = xmalloc(screensize); | 731 | s = screen = xmalloc(screensize); |
732 | // initialize the new screen. assume this will be a empty file. | 732 | // initialize the new screen. assume this will be a empty file. |
733 | screen_erase(); | 733 | screen_erase(); |
734 | // non-existent text[] lines start with a tilde (~). | 734 | // non-existent text[] lines start with a tilde (~). |
735 | for (li = 1; li < ro - 1; li++) { | 735 | //screen[(1 * co) + 0] = '~'; |
736 | screen[(li * co) + 0] = '~'; | 736 | //screen[(2 * co) + 0] = '~'; |
737 | //.. | ||
738 | //screen[((ro-2) * co) + 0] = '~'; | ||
739 | ro -= 2; | ||
740 | while (--ro >= 0) { | ||
741 | s += co; | ||
742 | *s = '~'; | ||
737 | } | 743 | } |
738 | return screen; | ||
739 | } | 744 | } |
740 | 745 | ||
741 | //----- Synchronize the cursor to Dot -------------------------- | 746 | //----- Synchronize the cursor to Dot -------------------------- |